[Python-ideas] Is there any idea about dictionary destructing?
Joao S. O. Bueno
jsbueno at python.org.br
Mon Apr 9 21:23:04 EDT 2018
On 9 April 2018 at 22:10, Brett Cannon <brett at python.org> wrote:
>
>
> On Mon, 9 Apr 2018 at 05:18 Joao S. O. Bueno <jsbueno at python.org.br> wrote:
>>
>> we could even call this approach a name such as "function call".
>
>
> The harsh sarcasm is not really called for.
Indeed - on rereading, I have to agree on that.
I do apologize for the sarcasm. - really, I not only stand corrected:
I recognize i was incorrect to start with.
But my argument that this feature is needless language bloat stands.
On the othe hand, as for getting variable names out of _shallow_ mappings,
I've built that feature in a package I authored, using a context manager
to abuse the import mechanism -
In [96]: from extradict import MapGetter
In [97]: data = {"A": None, "B": 10}
In [98]: with MapGetter(data):
...: from data import A, B
...:
In [99]: A, B
Out[99]: (None, 10)
That is on Pypi and can be used by anyone right now.
More information about the Python-ideas
mailing list