-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
__static_attributes__
class attribute from Python 3.13
#12136
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
Comments
I believe it's only defined on pure-Python classes, which isn't expressible in the type system. Probably the only safe way of accessing this attribute is by doing something like There's a similar situation with the new |
The same thing is true for |
We usually tend to add sometimes-defined attributes (with a comment) on the policy that false negatives are preferable to false positives. That said, maybe it's time to turn python/typing#601 into a PEP to formalize this behavior. |
Could Python define |
Python 3.13 introduced
__static_attributes__
special attribute for classes. The trick is - it is not defined onobject
...What is the best way to declare it in
typeshed
? Asobject
attribute anyway? Or there is no way atm?The text was updated successfully, but these errors were encountered: