[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

Ethan Furman report at bugs.python.org
Sun Mar 22 01:20:26 EDT 2020


Ethan Furman <ethan at stoneleaf.us> added the comment:

Jonathan Hsu, you are correct -- and "don't do that" was my initial response; but Enum takes many pains to make sure the user doesn't shoot themselves in the foot, so raising a TypeError is appropriate instead of silently doing the wrong thing.

----------

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


More information about the Python-bugs-list mailing list