New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unreachable condition: if enum_class._member_type_ is object
#90454
Comments
This condition can never be Lines 222 to 223 in b127e70
Why? Because:
So, I guess that removing this condition can simplify the I will send a PR shortly. |
(2) is false. >>> from enum import Enum
>>>
>>> class MyEnum(Enum):
... def __new__(cls, value):
... member = object.__new__(cls)
... return member
... ONE = 1
...
>>> MyEnum.ONE
MyEnum.ONE
>>> MyEnum._use_args_
True
>>> MyEnum._member_type_
<class 'object'> If coverage shows a branch not being tested, design a test for it instead of removing the branch. |
Yes, this is just a missing test. Not a wrong condition! |
Thank you, Nikita! |
enum.py
which covers_use_args == True
and_member_type_ == object
#30458Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: