Nick Coghlan <ncogh...@gmail.com> added the comment:

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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43838>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to