[issue30545] Enum equality across modules: comparing objects instead of values

Ethan Furman report at bugs.python.org
Fri Jun 2 11:23:11 EDT 2017


Ethan Furman added the comment:

Two points:

- Python 2.7 was the version marked, but 2.7 does not come with Enum
  (wasn't introduced until 3.4 -- the third-party backport does work
  on 2.7)

- the problem in the SO question is not caused by Enum, but by
  re-importing a module under a different name which results in two
  different Enum classes that happen to look identical, but are not --
  so the change you propose would not help; also, since Enum members
  with the same value are mapped to the same member your change does not
  provide any new behavior.

So, in summary, the bug here is in the user's code.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions: +Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30545>
_______________________________________


More information about the Python-bugs-list mailing list