-
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
RUF045 on dataclass method assignment #16360
Comments
The suggestion in the documentation and "help" text of the rule is still correct: annotating the assignment with
Good questions! I think the lint is correct to emit here: You can have dataclass fields that are typed as In the discussion of the PR for this rule, I think there was some connection drawn to this issue around
But I really don't think those complaints apply to All that being said: It seems like the situation is unclear enough that the current issue was submitted. So I'm happy to be convinced I'm wrong here, and to hear other points of view! |
Or, perhaps, how about applying RUF045 only before |
The semantics of such a bare |
I appreciate RUF045 (I forget to type dataclass fields time to time), but |
Description
ruff version: 0.9.7
command:
ruff check test.py --select RUF --preview
I am not sure if it's intended, but ruff check RUF045 for assigning a method of dataclass.
Is there a more appropriate way for typing new method, perhaps?
The text was updated successfully, but these errors were encountered: