Message398700
Ouch, you're right - I forgot that dict just returned NotImplemented from comparisons and unions and made it the other operand's problem:
>>> d1 = dict(x=1)
>>> d2 = dict(x=1)
>>> from types import MappingProxyType as proxy
>>> d1.__eq__(proxy(d2))
NotImplemented
>>> d1.__or__(proxy(d2))
NotImplemented
Perhaps we could mitigate the performance hit by skipping the copy when the other side is either a builtin dict (subclasses don't count), or a proxy around a builtin dict? |
|
Date |
User |
Action |
Args |
2021-08-01 14:33:00 | ncoghlan | set | recipients:
+ ncoghlan, gvanrossum, rhettinger, serhiy.storchaka, brandtbucher, domdfcoding |
2021-08-01 14:33:00 | ncoghlan | set | messageid: <1627828380.54.0.238589539168.issue43838@roundup.psfhosted.org> |
2021-08-01 14:33:00 | ncoghlan | link | issue43838 messages |
2021-08-01 14:33:00 | ncoghlan | create | |
|