[issue32218] add __iter__ to enum.Flag members

2021-01-13 Thread Ethan Furman
Ethan Furman added the comment: Final outcome: `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. -- resolution: -> fixed stage: patch

[issue32218] add __iter__ to enum.Flag members

2020-11-18 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: 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. -- nosy:

[issue32218] add __iter__ to enum.Flag members

2020-11-18 Thread hongweipeng
Change by hongweipeng : -- nosy: +hongweipeng nosy_count: 5.0 -> 6.0 pull_requests: +22261 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/23368 ___ Python tracker

[issue32218] add __iter__ to enum.Flag members

2020-09-19 Thread Ethan Furman
Ethan Furman added the comment: Problem: What to do when the Flag has compound members? class Color(Flag): BLACK = 0 RED = 1 GREEN = 2 BLUE = 4 PURPLE = RED|BLUE WHITE = RED|GREEN|BLUE I think the answer is: only return the single members.

[issue32218] add __iter__ to enum.Flag members

2020-09-17 Thread Ethan Furman
Change by Ethan Furman : -- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.8 ___ Python tracker

[issue32218] add __iter__ to enum.Flag members

2020-09-12 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21276 stage: -> patch review pull_request: https://github.com/python/cpython/pull/1 ___ Python tracker ___

[issue32218] add __iter__ to enum.Flag members

2018-01-29 Thread Ethan Furman
Ethan Furman added the comment: 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? * as of version 2.0.10, available on PyPI, and I am its author -- nosy: +barry,

[issue32218] add __iter__ to enum.Flag members

2018-01-18 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman stage: -> needs patch ___ Python tracker ___

[issue32218] add __iter__ to enum.Flag members

2017-12-04 Thread Berker Peksag
Change by Berker Peksag : -- nosy: +ethan.furman ___ Python tracker ___ ___

[issue32218] add __iter__ to enum.Flag members

2017-12-04 Thread Guy Gangemi
New submission from Guy Gangemi : I'm proposing to extend enum.Flag member functionality so it is iterable in a manner similar to enum.Flag subclasses. from enum import Flag, auto class FlagIter(Flag): def __iter__(self): for memeber in