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 15:31:56 +0000

Ok, understood. I've used PMT before, just not this function.

Adrian

On March 9, 2021 2:46:29 PM UTC, Jacob Gilbert <jacobgilbert@protonmail.com> wrote:
What Jeff is proposing is a small change to the behavior of the cpp pmt::is_dict() function, so not just Python API. It is exposed to python as pmt.is_dict().

Jacob


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, March 9, 2021 1:23 AM, Adrian Musceac <kantooon@gmail.com> wrote:

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]