[issue33437] Defining __init__ in enums

Ethan Furman report at bugs.python.org
Mon May 7 15:12:28 EDT 2018


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

Setting _value_ needs to happen in __new__ for those cases where another data type, such as str or int, is mixed in.

I'll look at adding an example to the docs.

Thanks for the report!

----------
assignee:  -> ethan.furman
components: +Documentation
nosy: +barry, eli.bendersky, ethan.furman
type: enhancement -> behavior
versions: +Python 3.7, Python 3.8

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


More information about the Python-bugs-list mailing list