On Fri, Jan 24, 2020 at 10:44 PM Steven D'Aprano <[email protected]> wrote: > > The only thing I'm unsure of here is whether direct use of the `==` and > `!=` operators are included as "implicit calls" to the dunders. I > *think* I understand Guido's intention, but I'm not sure: > > * x == y MUST call `__eq__` > > * likewise x != y MUST call `__ne__` > > * but compound objects such as lists and other collections MAY skip > calling `__eq__` (or `__eq__`) on their component parts. >
Are there any non-container uses where this comes up? Can the rule be codified simply as that container membership, in all core/stdlib types, is defined by "x is y or x == y"? (And possibly some additional words regarding recursive equality, if that isn't considered to be an extension of "membership".) ChrisA _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/YE3X3IDZB4RI4ZJHSQEKX67EFJTLYYQA/ Code of Conduct: http://python.org/psf/codeofconduct/
