You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enum Flag: psuedo-members have None for name attribute #84223
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/ethanfurman'closed_at=<Date2021-02-01.20:13:25.010>created_at=<Date2020-03-22.12:45:27.948>labels= ['type-feature', '3.9']
title='Enum Flag: psuedo-members have None for name attribute'updated_at=<Date2021-02-01.20:13:25.010>user='https://github.com/ethanfurman'
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:
Establish another way to determine whether self is a composite or not, and change they way _name_ is initialised.
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).
Activity
fbidu commentedon May 18, 2020
Hi,
Can you elaborate on this?
Thanks!
iritkatriel commentedon Sep 23, 2020
I believe this is what Rahul means:
# Note, however that:
assert str(Color.RED | Color.BLUE | Color.GREEN) == "Color.GREEN|BLUE|RED"
iritkatriel commentedon Sep 26, 2020
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:
Establish another way to determine whether self is a composite or not, and change they way _name_ is initialised.
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).
ethanfurman commentedon Feb 1, 2021
This issue is fixed in bpo-38250.