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
This commit changed the definition of abstractclassmethod and abstractstaticmethod in a way that makes them no longer callable. That means they cannot be used with other decorators (like property) that require a callable.
The following previously type checked without errors, but it no longer works.
The new declaration of abstractclassmethod and abstractstaticmethod also completely obscure the signature of the function they're decorating, which is a big problem for type checking (and completion suggestions, etc.).
I recommend reverting the change for abstractclassmethod and abstractstaticmethod. If there is a compelling reason to wrap these in a class, then the class should be parameterized with a ParamSpec and should include a __call__ method so it is still callable. @srittau, do you have a preference?
I won't be able to incorporate the latest typeshed stubs into pyright or pylance until this is addressed because this regression results in significant problems for internal Microsoft code bases.
The text was updated successfully, but these errors were encountered:
Digging into this further, most of the uses of abstractclassmethod and abstractstaticmethod in our internal code base were inappropriate uses. These decorators are deprecated as of Python 3.2, so they shouldn't generally be used. But I think the recent change is still problematic.
This commit changed the definition of
abstractclassmethod
andabstractstaticmethod
in a way that makes them no longer callable. That means they cannot be used with other decorators (likeproperty
) that require a callable.The following previously type checked without errors, but it no longer works.
The new declaration of
abstractclassmethod
andabstractstaticmethod
also completely obscure the signature of the function they're decorating, which is a big problem for type checking (and completion suggestions, etc.).I recommend reverting the change for
abstractclassmethod
andabstractstaticmethod
. If there is a compelling reason to wrap these in a class, then the class should be parameterized with a ParamSpec and should include a__call__
method so it is still callable. @srittau, do you have a preference?I won't be able to incorporate the latest typeshed stubs into pyright or pylance until this is addressed because this regression results in significant problems for internal Microsoft code bases.
The text was updated successfully, but these errors were encountered: