Message378436
Part of this issue (#1) was intended to be addressed by https://github.com/python/cpython/pull/22221 which added an `__iter__` implementation to Flag and IntFlag. (The PR did not reference this issue, and was already merged last month.)
However that PR seems problematic on several counts:
1. `__iter__` diverges from the existing `__contains__`. The latter includes 0 and compound values
2. the implementation is fairly heavy
3. len() on an enum instance is going to be O(n)
I've put post-merge comments on the PR.
I think it would be safer to have an explicitly named `bits()` iterator on flag instances, rather than use `__iter__()`. |
|
Date |
User |
Action |
Args |
2020-10-11 14:24:15 | John Belmonte | set | recipients:
+ John Belmonte, ethan.furman, veky, Manjusaka |
2020-10-11 14:24:15 | John Belmonte | set | messageid: <1602426255.05.0.97296464738.issue38250@roundup.psfhosted.org> |
2020-10-11 14:24:14 | John Belmonte | link | issue38250 messages |
2020-10-11 14:24:14 | John Belmonte | create | |
|