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: Jeff Long
Subject: Re: RFC: Behavior of pmt.is_dict() in v3.8
Date: Tue, 9 Mar 2021 07:24:50 -0500

PMT dict is a different kind of thing, so if you do not use PMT for message passing or tags, this won't affect you at all. Should have put that up front. Thanks for the reply!

On Tue, Mar 9, 2021 at 3:25 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]