[issue46739] dataclasses __eq__ isn't logical

Eric V. Smith report at bugs.python.org
Sun Feb 13 13:50:00 EST 2022


Eric V. Smith <eric at trueblade.com> added the comment:

I agree with Mark. It's identical to:

>>> () == ()
True

As for the non-dataclass version, that's a normal object identity comparison if no __eq__ is defined: https://docs.python.org/3/reference/datamodel.html#object.__eq__ , third paragraph.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46739>
_______________________________________


More information about the Python-bugs-list mailing list