Skip to content
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

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

cburroughs
Copy link
Contributor

ref #21647

@cburroughs cburroughs self-assigned this Dec 20, 2024
@cburroughs cburroughs added the release-notes:not-required PR doesn't require mention in release notes label Dec 20, 2024
@@ -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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@cburroughs cburroughs marked this pull request as ready for review December 20, 2024 18:59
@huonw huonw merged commit 376be9c into pantsbuild:main Dec 22, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:not-required PR doesn't require mention in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants