-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
E721: Do not compare types, use 'isinstance()' #21791
Conversation
@@ -214,7 +214,7 @@ def __hash__(self): | |||
return hash(type) | |||
|
|||
def __eq__(self, other): | |||
return type(self) == type(other) | |||
return type(self) == type(other) # noqa: E721 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of a an intentional test.
@@ -309,7 +309,7 @@ def __init__(self, options: OptionValueContainer) -> None: | |||
self.options = options | |||
|
|||
def __eq__(self, other: Any) -> bool: | |||
if type(self) != type(other): | |||
if type(self) != type(other): # noqa: E721 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust engine magic I could not figure out.
@@ -29,7 +29,7 @@ def __new__(cls, rank: int, display: str) -> Rank: | |||
return member | |||
|
|||
def __lt__(self, other: Any) -> bool: | |||
if type(other) != Rank: | |||
if type(other) != Rank: # noqa: E721 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust engine / typing magic I could not figure out.
ref #21647