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
fromenumimportEnumclassE(Enum):
_order_='X Y Z'# Should be 'X Y'X=1Y=2
But, in runtime it fails:
» python out/ex.py
Traceback (most recent call last):
File "/Users/sobolev/Desktop/mypy/out/ex.py", line 3, in <module>
class E(Enum):
File "/Users/sobolev/.pyenv/versions/3.10.0/lib/python3.10/enum.py", line 348, in __new__
raise TypeError('member order does not match _order_')
TypeError: member order does not match _order_
We need to check that _order_ field is valid.
This can be a great addition to my "better Enums" series of PRs.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Right now this code passes type checking:
But, in runtime it fails:
We need to check that
_order_
field is valid.This can be a great addition to my "better Enums" series of PRs.
The text was updated successfully, but these errors were encountered: