-
Notifications
You must be signed in to change notification settings - Fork 23
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
Error for unnecessary "= ..." #98
Comments
The trouble with this check is that flake8 produces undefined name errors if you use a name defined with just Two possible solutions:
|
Following #364, flake8-with-flake8-pyi-installed no longer emits errors for this code: x: int
y = x That means we can now revisit this issue. |
I just saw astral-sh/ruff#8818 and I've been wondering, should this apply to enums? Given they can be dynamically generated. Maybe that's not a use-case we'd want to support. |
I don't see any particular reason that this hypothetical check should exclude enums — the following two enums in a stub file should (I think) be interpreted the same way by a type checker, but the second one is more explicit: from _typeshed import Incomplete
class Foo(Enum):
X = ...
Y = ...
class Bar(Enum):
X: Incomplete
Y: Incomplete If code generators are currently generating Foo, instead of Bar, we should fix the code generators ;) That said, I think the ruff maintainers are correct to say in astral-sh/ruff#8818 that PIE796 probably shouldn't emit an error on |
This was previously Y0092, and it was removed because it had problems: #88
The text was updated successfully, but these errors were encountered: