Message398023
I believe that delegating to the actual underlying mapping without exposing it is a bit of a lost cause, since for some type m we still need these to work:
>>> types.MappingProxyType(m({"a": 0)) | types.MappingProxyType(m({"b": 1}))
m({'a': 0, 'b': 1})
>>> types.MappingProxyType(m({"a": 0)) == types.MappingProxyType(m({"a": 0}))
True
(Note that because both sides are proxies, it's impossible for any resolution to happen without m explicitly knowing how to handle them unless both mappings are unwrapped simultaneously.)
Instead, the attached PR delegates to a *copy* of the underlying mapping for these operations instead. I think this is the easiest way to approximate the current behavior while maintaining proper encapsulation. |
|
Date |
User |
Action |
Args |
2021-07-23 01:09:36 | brandtbucher | set | recipients:
+ brandtbucher, gvanrossum, rhettinger, ncoghlan, serhiy.storchaka |
2021-07-23 01:09:36 | brandtbucher | set | messageid: <1627002576.87.0.902766966205.issue43838@roundup.psfhosted.org> |
2021-07-23 01:09:36 | brandtbucher | link | issue43838 messages |
2021-07-23 01:09:36 | brandtbucher | create | |
|