Message394457
With the change introduced in https://bugs.python.org/issue38250 https://github.com/python/cpython/commit/7aaeb2a3d682ecba125c33511e4b4796021d2f82 I observe a regression in behavior of enum.IntFlag with missing values.
Consider this code (from pyproj):
from enum import IntFlag
class GeodIntermediateFlag(IntFlag):
DEFAULT = 0x0
NPTS_MASK = 0xF
NPTS_ROUND = 0x0
NPTS_CEIL = 0x1
NPTS_TRUNC = 0x2
DEL_S_MASK = 0xF0
DEL_S_RECALC = 0x00
DEL_S_NO_RECALC = 0x10
AZIS_MASK = 0xF00
AZIS_DISCARD = 0x000
AZIS_KEEP = 0x100
This is a valid code in Python 3.9, however produces a TypeError in Python 3.10.0b1:
Traceback (most recent call last):
File "intflag.py", line 3, in <module>
class GeodIntermediateFlag(IntFlag):
File "/usr/lib64/python3.10/enum.py", line 544, in __new__
raise TypeError(
TypeError: invalid Flag 'GeodIntermediateFlag' -- missing values: 4, 8, 32, 64, 128, 512, 1024, 2048
Since I don't see this behavior mentioned in https://docs.python.org/3.10/library/enum.html or https://docs.python.org/3.10/whatsnew/3.10.html or https://docs.python.org/3.10/whatsnew/changelog.html I believe this is a regression. |
|
| Date |
User |
Action |
Args |
| 2021-05-26 19:31:43 | hroncok | set | recipients:
+ hroncok, jbelmonte, ethan.furman, veky, Manjusaka, John Belmonte, hauntsaninja |
| 2021-05-26 19:31:43 | hroncok | set | messageid: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> |
| 2021-05-26 19:31:43 | hroncok | link | issue44242 messages |
| 2021-05-26 19:31:42 | hroncok | create | |
|