Message399234
`types.MappingProxyType` is documented as 'Read-only proxy of a mapping'.
But if used with a `collections.defaultdict` mapping, it can modify the underlying mapping.
```
import collections, types
dd = collections.defaultdict(set)
mpt = types.MappingProxyType(dd)
mpt['__getitem__'] # key inserted
mpt.get('get') # key not inserted
print(dd.items()) # dict_items([('__getitem__', set())])
``` |
|
Date |
User |
Action |
Args |
2021-08-08 19:16:15 | guoci | set | recipients:
+ guoci |
2021-08-08 19:16:15 | guoci | set | messageid: <1628450175.86.0.732506438572.issue44867@roundup.psfhosted.org> |
2021-08-08 19:16:15 | guoci | link | issue44867 messages |
2021-08-08 19:16:15 | guoci | create | |
|