You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I want to follow "best practices", I've got to put a Final[ ] wrapper around most type hints I use. Could there be a mypy flag to assume every type hint is final unless it's got a Mut[ ] wrapper?
Would probably require a search-replace script to convert a project between the modes, but that doesn't sound too bad.
Pitch
Variables being constant when you won't need to change them is generally regarded as a good idea, right? This would make it easier, like Rust does.
I don't know about any of the mypy internals, but this doesn't strike me as too big a change?
Interface change would be a new --final-as-default flag.
The text was updated successfully, but these errors were encountered:
I think that it needs to be clarified, that the flag should be something like --implicit-final-vars, because final might also mean classes, methods, etc.
Yes! I'm making myself to use Final in my code frequently and most of the time the variables aren't really mutated, so having a mode where Final would be implicit would be really helpful.
Feature
If I want to follow "best practices", I've got to put a
Final[ ]
wrapper around most type hints I use. Could there be a mypy flag to assume every type hint is final unless it's got aMut[ ]
wrapper?Would probably require a search-replace script to convert a project between the modes, but that doesn't sound too bad.
Pitch
Variables being constant when you won't need to change them is generally regarded as a good idea, right? This would make it easier, like Rust does.
I don't know about any of the mypy internals, but this doesn't strike me as too big a change?
Interface change would be a new
--final-as-default
flag.The text was updated successfully, but these errors were encountered: