8000 gh-134370 Added clarification on instances annotations by AlexKautz · Pull Request #134387 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-134370 Added clarification on instances annotations #134387

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

Conversation

AlexKautz
Copy link
Contributor
@AlexKautz AlexKautz commented May 20, 2025

[Hello from PyCon sprints!]
Instances of classes cannot have annotations,
however sometimes they will erroneously have the
annotations attribute.

@python/proofreaders could you take a look? This is my first Python documentation writing so I'm sure there's a mistake somewhere :).


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

Instances of classes cannot have annotations,
however sometimes they will erroneously have the
__annotations__ attribute
@gpshead gpshead requested a review from JelleZijlstra May 20, 2025 20:17
Copy link
Contributor
@willingc willingc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me. I would like @JelleZijlstra to also review from a typing perspective. Thank you @AlexKautz.

@AlexKautz
Copy link
Contributor Author

I also swapped a e.g. for for example following https://devguide.python.org/documentation/style-guide/#use-simple-language

@AlexKautz AlexKautz requested a review from JelleZijlstra May 21, 2025 03:46
@JelleZijlstra JelleZijlstra added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels May 22, 2025
@JelleZijlstra JelleZijlstra merged commit bd4046f into python:main May 22, 2025
28 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs May 22, 2025
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2025
…H-134387)

Instances of classes cannot have annotations,
however sometimes they will erroneously have the
__annotations__ attribute
(cherry picked from commit bd4046f)

Co-authored-by: Alex Kautz <alex@takemobi.com>
@miss-islington-app
Copy link

Sorry, @AlexKautz and @JelleZijlstra, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker bd4046f4f869039a1a2ebe2d1d18bfbc2a2951b6 3.13

@bedevere-app
Copy link
bedevere-app bot commented May 22, 2025

GH-134509 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 22, 2025
@JelleZijlstra JelleZijlstra removed the needs backport to 3.13 bugs and security fixes label May 22, 2025
JelleZijlstra pushed a commit that referenced this pull request May 22, 2025
) (#134509)

gh-134370: Added clarification on instance annotations (GH-134387)

Instances of classes cannot have annotations,
however sometimes they will erroneously have the
__annotations__ attribute
(cherry picked from commit bd4046f)

Co-authored-by: Alex Kautz <alex@takemobi.com>
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 news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
0