Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132457: make staticmethod and classmethod generic#132460

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

IvanKirpichnikov
Copy link
Contributor

@IvanKirpichnikovIvanKirpichnikov commentedApr 12, 2025
edited by bedevere-appbot
Loading

@python-cla-bot
Copy link

python-cla-botbot commentedApr 12, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@picnixz

This comment was marked as resolved.

@sobolevn

This comment was marked as resolved.

@sobolevnsobolevn reopened thisApr 12, 2025
@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

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

I think it's pretty rare for people to usestaticmethod andclassmethod 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 reviewApril 29, 2025 09:54
@IvanKirpichnikov
Copy link
ContributorAuthor

IvanKirpichnikov commentedApr 29, 2025
edited
Loading

I think it's pretty rare for people to usestaticmethod andclassmethod 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 commita363675 intopython:mainMay 4, 2025
42 checks passed
diegorusso added a commit to diegorusso/cpython that referenced this pull requestMay 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)  ...
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra left review comments

@sobolevnsobolevnsobolevn approved these changes

@hauntsaninjahauntsaninjaAwaiting requested review from hauntsaninja

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@IvanKirpichnikov@picnixz@sobolevn@AlexWaygood@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp