-
Notifications
You must be signed in to change notification settings - Fork 179
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
should produce error for attribute hidden by a method #760
Comments
a function overriding a variable is almost always an error -- if you want to do exceptional things you can utilize |
note that your example under "reasons" is unrelated and works fine |
@asottile thanks for the response! I explained myself in a wrong way. I expected I.e. I don't need to disable existed error, I want more strict rule. |
ah ok the title misled me -- I've updated it |
try out #761 ? |
How to reproduce
ok.py
fail.py
Reasons
I do understand that redefinition of variables is a useful pattern, for example
structlog
Bound Loggers uses it extensively.Problems
I spent some time debugging a problem in our code base related to Factory Boy Lazy Attributes.
Proposal
Deny attribute redefinition inside class body.
Thoughts?
The text was updated successfully, but these errors were encountered: