-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
no error when calling abstract staticmethod
/classmethod
#14939
Comments
Note that the error is currently only generated when constructing an instance, since when calling a method on an instance, the runtime object could be an instance of a subclass with the method implemented. We'd need to add add a new check when accessing an abstract static method (possibly also class method) of a direct reference to a type object, but not when using |
Hi, I was looking into picking this up but was unsure where was the best place in the code to put this in. I have created a test to reproduce and the bug still exists. Should this be a separate check within |
… that is marked abstract. This addresses python/mypy#14939.
This is (largely) a duplicate of #14939. As Jukka says, the current behavior is to report the problem when an abstract class is instantiated. This mirrors the error seen at runtime. And as discussed in the duplicate issue, there's a good reason not to emit an error when a class method or static method is called here. Recommend closing. |
#14939 is this issue, which one were you thinking of? |
Oops, I meant #14062. |
Thanks, I feel this one different and more reasonable as a feature request, as here the ask is to warn about calls to abstract static/classmethods, while #14062 wanted a warning for calls to non-abstract static/classmethods on abstract classes. Jukka's comment above explains how such a check could be implemented. |
I want to work on this. |
playground
The text was updated successfully, but these errors were encountered: