[issue40042] Enum Flag: psuedo-members have None for name attribute
Irit Katriel
report at bugs.python.org
Sat Sep 26 06:29:14 EDT 2020
Irit Katriel <iritkatriel at yahoo.com> added the comment:
I see in the code of _create_pseudo_member_ that _name_ is deliberately set to None, and furthermore in __str__ and __repr__ the fact that it is None is used to determine whether self is a composite (pseudo) or not.
So first question is whether this should be fixed.
If so, I see two options:
1. Establish another way to determine whether self is a composite or not, and change they way _name_ is initialised.
2. Leave _name_ as is, but override name (which currently is defined in Enum and simply returns _name_ but can be redefined to do something else).
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40042>
_______________________________________
More information about the Python-bugs-list
mailing list