-
Notifications
You must be signed in to change notification settings - Fork 42
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
Transform constants to variables with Final
type hint
#178
Comments
@yegor256 can you approve this as an issue, please? |
@yegor256 can you check it, please? |
@ilnarkhasanov sounds like a reasonable suggestion, but let's first find out why Pylint doesn't complain about this:
Maybe we should use some other linter on top of pylint? |
Looks like pep doesn't force us to declare constants in top level. but you can extend your pylint with your own plugins using |
@howcanunot please, try!) |
According to PEP-0008, constants are usually declared at a module level.
In ast.py, (lines 366-368) we have 2 constants declared in
if
The idea behind it is clear:
JAVA
andMETRICS
must not be changed.What we can do is using
Final
type hint. It states that variable or attribute should not be reassigned, redefined, or overridden.Suggestion:
The text was updated successfully, but these errors were encountered: