Dictionary Views in Python
In Python, dictionary views actually change their data if the underlying dictionary changes. Let's remove some keys:
It also works for the items:
Note that once the dict_items
object is cast into a list, it loses the reference to the data item.
And, just out of curiosity and, as expected, it is not serializable:
Backlinks
These are the other notes that link to this one.
Nothing links here, how did you reach this page then?
Comment
Share your thoughts on this note. Comments are not public, they are
messages sent directly to my inbox.