discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: Behavior of pmt.is_dict() in v3.8


From: Adrian Musceac
Subject: Re: RFC: Behavior of pmt.is_dict() in v3.8
Date: Tue, 09 Mar 2021 08:23:20 +0000

Is this strictly Python API? If yes, it would be very unusual to use this function in Python. I think most people would write

type(x) is dict
Or
isinstance(x, dict)

So I think you're safe to backport this change.

Adrian

On March 8, 2021 9:18:00 PM UTC, Jeff Long <willcode4@gmail.com> wrote:
Looking for comments on a v3.8 change in behavior.

The PMT library in GNU Radio contains a function is_dict(x) that returns a boolean if the object x is a dictionary. It also returns True if x is a pair. This is a longstanding design oddity or bug (take your pick).

In v3.9 and higher, is_dict(x) will return False if x is not a dictionary, which is what you would expect. None of the OOT packages I've looked at depend on the current behavior. In fact, some of them would be surprised by it. So, I am leaning toward backporting this to v3.8.

Is there anyone/anysoftware that depends on is_dict(x) returning True if x is a pair?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]