Skip to content

Conversation

@IvanKirpichnikov
Copy link
Contributor

@IvanKirpichnikovIvanKirpichnikov commented Apr 12, 2025

@python-cla-bot
Copy link

python-cla-botbot commented Apr 12, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

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.

@picnixz

This comment was marked as resolved.

@picnixzpicnixz closed this Apr 12, 2025
@sobolevn

This comment was marked as resolved.

@sobolevnsobolevn reopened this Apr 12, 2025
@bedevere-app
Copy link

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.

@IvanKirpichnikovIvanKirpichnikov marked this pull request as draft April 12, 2025 22:38
@sobolevnsobolevn marked this pull request as ready for review April 28, 2025 22:51
@AlexWaygood
Copy link
Member

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.

@AlexWaygoodAlexWaygood removed their request for review April 29, 2025 09:54
@IvanKirpichnikov
Copy link
ContributorAuthor

IvanKirpichnikov commented Apr 29, 2025

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.

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

Copy link
Member

@JelleZijlstraJelleZijlstra left a comment

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

Copy link
Member

@sobolevnsobolevn left a comment

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!

@sobolevnsobolevn merged commit a363675 into python:mainMay 4, 2025
42 checks passed
diegorusso added a commit to diegorusso/cpython that referenced this pull request May 4, 2025
* origin/main: (111 commits) pythongh-91048: Add filename and line number to external inspection routines (pythonGH-133385) pythongh-131178: Add tests for `ast` command-line interface (python#133329) Regenerate pcbuild.sln in Visual Studio 2022 (python#133394) pythongh-133042: disable HACL* HMAC on Emscripten (python#133064) pythongh-133351: Fix remote PDB's multi-line block tab completion (python#133387) pythongh-109700: Improve stress tests for interpreter creation (pythonGH-109946) pythongh-81793: Skip tests for os.link() to symlink on Android (pythonGH-133388) pythongh-126835: Rename `ast_opt.c` to `ast_preprocess.c` and related stuff after moving const folding to the peephole optimizier (python#131830) pythongh-91048: Relax test_async_global_awaited_by to fix flakyness (python#133368) pythongh-132457: make staticmethod and classmethod generic (python#132460) pythongh-132805: annotationlib: Fix handling of non-constant values in FORWARDREF (python#132812) pythongh-132426: Add get_annotate_from_class_namespace replacing get_annotate_function (python#132490) pythongh-81793: Always call linkat() from os.link(), if available (pythonGH-132517) pythongh-122559: Synchronize C and Python implementation of the io module about pickling (pythonGH-122628) pythongh-69605: Add PyREPL import autocomplete feature to 'What's New' (python#133358) bpo-44172: Keep reference to original window in curses subwindow objects (pythonGH-26226) pythonGH-133231: Changes to executor management to support proposed `sys._jit` module (pythonGH-133287) pythongh-133363: Fix Cmd completion for lines beginning with `! ` (python#133364) pythongh-132983: Introduce `_zstd` bindings module (pythonGH-133027) pythonGH-91048: Add utils for printing the call stack for asyncio tasks (python#133284) ...
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@IvanKirpichnikov@picnixz@sobolevn@AlexWaygood@JelleZijlstra