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-144190: Clarify get_type_hints() instance behavior in docs#144831

Merged
hugovk merged 1 commit intopython:mainfrom
iamrajhans:gh-144190-get-type-hints-docs
Feb 26, 2026
Merged

gh-144190: Clarify get_type_hints() instance behavior in docs#144831
hugovk merged 1 commit intopython:mainfrom
iamrajhans:gh-144190-get-type-hints-docs

Conversation

@iamrajhans
Copy link
Contributor

@iamrajhansiamrajhans commentedFeb 15, 2026
edited by github-actionsbot
Loading

Summary

Documenttyping.get_type_hints() behavior for instance objects in Python 3.14+.

  • Clarify thatget_type_hints() is intended for modules, classes, and callables.
  • Add an explicit note that callingget_type_hints() on instances is not supported.
  • Recommendget_type_hints(type(obj)) for instance use cases.
  • Add aversionchanged:: 3.14 note explaining that instance support in earlier versions was undocumented behavior.

Why

Issue#144190 reported a regression when callingget_type_hints(self) in a dataclass__init__.
Core-dev discussion confirmed this is intentional in 3.14 and should be documented.

Testing

Docs-only change; no runtime behavior changed.


📚 Documentation preview 📚:https://cpython-previews--144831.org.readthedocs.build/

@JelleZijlstraJelleZijlstra added the needs backport to 3.14bugs and security fixes labelFeb 15, 2026
@hugovkhugovk merged commite234662 intopython:mainFeb 26, 2026
42 checks passed
@github-project-automationgithub-project-automationbot moved this fromTodo toDone inDocs PRsFeb 26, 2026
@miss-islington-app
Copy link

Thanks@iamrajhans for the PR, and@hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestFeb 26, 2026
…ythonGH-144831)(cherry picked from commite234662)Co-authored-by: Rajhans Jadhao <rajhans.jadhao@gmail.com>
@bedevere-app
Copy link

GH-145258 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelFeb 26, 2026
hugovk pushed a commit that referenced this pull requestFeb 26, 2026
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

@AlexWaygoodAlexWaygoodAwaiting requested review from AlexWaygoodAlexWaygood is a code owner

Assignees

No one assigned

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@iamrajhans@JelleZijlstra@hugovk

[8]ページ先頭

©2009-2026 Movatter.jp