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
What does aenum do and has there been any feedback on it?
To me I would see what you suggest as surprising but I don't use enums often (I should use them more!) so take that with a grain of salt, and also surprising != wrong/not good.
Flag has been redesigned such that any flag comprised of a single bit is canonical; flags comprised of multiple bits are considered aliases. During iteration only canonical flags are returned.
Activity
GuyGangemi commentedon Dec 5, 2017
I'm proposing to extend enum.Flag member functionality so it is iterable in a manner similar to enum.Flag subclasses.
ethanfurman commentedon Jan 30, 2018
This functionality is now in the third-party aenum* library.
Are there any strong use-cases for this behavior such that it should be in the stdlib?
ethanfurman commentedon Sep 19, 2020
Problem: What to do when the Flag has compound members?
I think the answer is: only return the single members. So
--> list(Color.WHITE)
[Color.BLUE, Color.GREEN, Color.RED]
Cryvate commentedon Nov 18, 2020
What does aenum do and has there been any feedback on it?
To me I would see what you suggest as surprising but I don't use enums often (I should use them more!) so take that with a grain of salt, and also surprising != wrong/not good.
ethanfurman commentedon Jan 14, 2021
Final outcome:
Flaghas been redesigned such that any flag comprised of a single bit is canonical; flags comprised of multiple bits are considered aliases. During iteration only canonical flags are returned.