[issue40890] Dict views should be introspectable

Dennis Sweeney report at bugs.python.org
Mon Jun 8 22:01:23 EDT 2020


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

Here's a workaround that's possible with PR 20749 applied:

>>> d = {"a":1, "b":2} # fill up the dict...
>>> DICT = object()
>>> d[DICT] = d
>>> items = d.items()
>>> del d
>>>
>>> d = items.mapping[DICT].pop(DICT)
>>> d
{'a': 1, 'b': 2}

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40890>
_______________________________________


More information about the Python-bugs-list mailing list