We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report
Enum is casted to literal when asserting its value, even when it is declared as attr of class that can be mutated after assertion
To Reproduce
from enum import Enum class MyEnum(Enum): A = 1 B = 2 class A: def __init__(self, enum: MyEnum): self.enum = enum def change(self) -> None: self.enum = MyEnum.B if __name__ == "__main__": a = A(MyEnum.A) assert a.enum == MyEnum.A a.change() assert a.enum == MyEnum.B
Expected Behavior
No error
Actual Behavior
Non-overlapping equality check (left operand type: "Literal[MyEnum.A]", right operand type: "Literal[MyEnum.B]")
Your Environment
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report
Enum is casted to literal when asserting its value, even when it is declared as attr of class that can be mutated after assertion
To Reproduce
Expected Behavior
No error
Actual Behavior
Non-overlapping equality check (left operand type: "Literal[MyEnum.A]", right operand type: "Literal[MyEnum.B]")
Your Environment
The text was updated successfully, but these errors were encountered: