Skip to content
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

Consistency with Final usage in Standard Library Stubs #12311

Open
max-muoto opened this issue Jul 10, 2024 · 3 comments
Open

Consistency with Final usage in Standard Library Stubs #12311

max-muoto opened this issue Jul 10, 2024 · 3 comments

Comments

@max-muoto
Copy link
Contributor

Currently usage of typing.Final to indicate constants is mixed throughout the standard library (e.g. some newer stubs will utilize it potentially, but it's left out in other places) Has there been any discussion in the past of experimenting with applying Final to all UPPER_UNDER module stdlib constants?

I think class var constants would require a bit more context on usage, as it might be expected for subclasses to override them, but it could be worth starting with modules and gauging the impact from MyPy primer.

@hauntsaninja
Copy link
Collaborator

Not that I recall! I think worth experimenting. IIRC pyright implicitly marks these as final

@max-muoto
Copy link
Contributor Author

Not that I recall! I think worth experimenting. IIRC pyright implicitly marks these as final

Yes, if you have the strictest settings enabled that is the case, but this doesn't apply to the default settings.

@max-muoto
Copy link
Contributor Author

Put up a PR here: #12318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants