Skip to content
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

[3.12] Improve documentation for typing.get_type_hints (GH-119928) #119944

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jun 2, 2024

  • Explicit list of what it does that is different from
    "just return annotations"
  • Remove reference to PEP 563; adding the future import doesn't
    do anything to type aliases, and in general it will never make
    get_type_hints() less likely to fail.
  • Remove example, as the Annotated docs already have a similar
    example, and it's unbalanced to have one example about this
    one edge case but not about other behaviors of the function.

(cherry picked from commit aa9fe98)

Co-authored-by: Jelle Zijlstra [email protected]
Co-authored-by: Alex Waygood [email protected]


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

- Explicit list of what it does that is different from
  "just return __annotations__"
- Remove reference to PEP 563; adding the future import doesn't
  do anything to type aliases, and in general it will never make
  get_type_hints() less likely to fail.
- Remove example, as the Annotated docs already have a similar
  example, and it's unbalanced to have one example about this
  one edge case but not about other behaviors of the function.

(cherry picked from commit aa9fe98)

Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
@JelleZijlstra JelleZijlstra self-assigned this Jun 2, 2024
@JelleZijlstra JelleZijlstra enabled auto-merge (squash) June 2, 2024 15:13
@JelleZijlstra JelleZijlstra merged commit c8de0ec into python:3.12 Jun 2, 2024
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants