-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
type-comparison (E721) only works on some builtin classes and nothing else #6465
Comments
I'm honestly tempted to revert the changes to this rule and just go back to pycodestyle parity, because I don't really understand the contexts in which pycodestyle is meant to be enforcing it, and it doesn't seem worth it to me to keep spending time refining it. (This rule in pycodestyle is not the same as For example, pycodestyle allows Separately, comparing |
(I added the missing builtin types at least.) |
IMHO ruff needs to allow stuff like |
@bdowning -- I believe we already allowed that if you run with |
@charliermarsh So I updated to 0.2.0 and I'm still only seeing stuff like
|
It's possible we missed this in the |
@zanieb Any word on this? Just checked with 0.3.5 and it looks like this is still behind the preview barrier. |
Hi. Now and then I want to do The |
@joaoe Can you try your example with |
Ok, there's a PR up which will resolve this: #11220 |
…` (`E721`) (#11220) ## Summary Stabilizes `E721` behavior implemented in #7905. The functionality change in `E721` was implemented in #7905, released in [v0.1.2](https://github.com/astral-sh/ruff/releases/tag/v0.1.2). And seems functionally stable since #9676, without an explicit release but would correspond to [v0.2.0](https://github.com/astral-sh/ruff/releases/tag/v0.2.0). So the deprecated functionally should be removable in the next minor release. resolves: #6465
The preview logic has been moved to stable and will be released as part of v0.5. Resolved by #11220 |
…` (`E721`) (#11220) ## Summary Stabilizes `E721` behavior implemented in #7905. The functionality change in `E721` was implemented in #7905, released in [v0.1.2](https://github.com/astral-sh/ruff/releases/tag/v0.1.2). And seems functionally stable since #9676, without an explicit release but would correspond to [v0.2.0](https://github.com/astral-sh/ruff/releases/tag/v0.2.0). So the deprecated functionally should be removable in the next minor release. resolves: #6465
…` (`E721`) (#11220) ## Summary Stabilizes `E721` behavior implemented in #7905. The functionality change in `E721` was implemented in #7905, released in [v0.1.2](https://github.com/astral-sh/ruff/releases/tag/v0.1.2). And seems functionally stable since #9676, without an explicit release but would correspond to [v0.2.0](https://github.com/astral-sh/ruff/releases/tag/v0.2.0). So the deprecated functionally should be removable in the next minor release. resolves: #6465
pylint's
unidiomatic-typecheck
detects all of these casesThe text was updated successfully, but these errors were encountered: