-
Notifications
You must be signed in to change notification settings - Fork 19
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
[SIM909] class attributes wrongly trigger reflexive assignments #129
Comments
You're absolutely right. SIM909 needs a fix. I hope in 1-2 hours I can release a new version with the fix. Thank you for reporting it! |
Pythonclass BaseMeta:
metadata = metadata AST
|
Class attribute assignments are not reflexive assignments Closes #129
Class attribute assignments are not reflexive assignments Closes #129
Let me know when the new release is out and I can test on my repo if you'd like 🙂 |
|
All the (now) false positives are gone, and it seems to run well. Thanks @MartinThoma! |
Nice! Thank you for reporting the issue and checking if the fix works! |
Desired change
Explanation
I have this code:
The
BaseMeta
class is used for database models as theMeta
baseclass.This is currently flagged by SIM909, but after reading through the rationale of the rule, I think this could be considered a false positive. Assignment of
metadata
tometadata
on a class is not the same as outside a class right - it actually serves a purpose 🙂What do you think?
The text was updated successfully, but these errors were encountered: