gh-132457: make staticmethod and classmethod generic by IvanKirpichnikov · Pull Request #132460 · python/cpython
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
sobolevn
marked this pull request as ready for review
I think it's pretty rare for people to use staticmethod and classmethod in annotations. But I do think it's generally good for the runtime and typeshed to agree with each other on whether a class is generic, so I'm weakly in favour of this PR. It doesn't really add a maintenance burden, and they've been generic in typeshed for a long time now without complaints from type-checker users. +0.5 from me.
I think it's pretty rare for people to use
staticmethodandclassmethodin annotations. But I do think it's generally good for the runtime and typeshed to agree with each other on whether a class is generic, so I'm weakly in favour of this PR. It doesn't really add a maintenance burden, and they've been generic in typeshed for a long time now without complaints from type-checker users. +0.5 from me.
Thank you for the plus.
However, the use of staticmethod and classmethod is found in the dishka library (here). I discovered this defect when I was fixing bugs in mypy
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel similarly to Alex
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also in favor of this PR, since you also have a real use-case it also boosts my confidence. Moreover, the PR is rather simple and understand and maintain.
Thank you!
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request
…2460) Co-authored-by: sobolevn <mail@sobolevn.me>