-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Add static analysis support to _util.Final #2683
Comments
Might be a nice case for just a lint to ensure we have both? I can't think of a solution here unfortunately. |
There is actually a better way, but it'd require some churn. By using The biggest downside is that we have to remember to use I don't think we need to care about backwards compatibility, since these are both private. |
Sounds like a decent enough solution to me 👍 |
…decorator. (#2793) * Reimplement _util.Final as a decorator, replace usages. * Use util.final along NoPublicConstructor * Add test to verify that all NoPublicConstructor classes are also final. --------- Co-authored-by: EXPLOSION <[email protected]>
See discussion in #2668 (comment)
@final
was added in 3.8, so it would be good to make classes decorated with_util.Final
also be treated as@final
by type checkers. I didn't find a good way of applying both with a single decorator or metaclass, so unless I missed a way we might have to have both on all classes. Or possibly skip one of them.The text was updated successfully, but these errors were encountered: