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

Already on GitHub?Sign in to your account

Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Updated note about Instances
  • Loading branch information
@AlexKautz
AlexKautz committedMay 21, 2025
commit91144a4c7f28b04f74fc6863c994875fadb6938d
8 changes: 4 additions & 4 deletionsDoc/howto/annotations.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -248,9 +248,9 @@ quirks by using :func:`annotationlib.get_annotations` on Python 3.14+ or
:func:`inspect.get_annotations` on Python 3.10+. On earlier versions of
Python, you can avoid these bugs by accessing the annotations from the
class's :attr:`~type.__dict__`
(e.g., ``cls.__dict__.get('__annotations__', None)``).
(for example, ``cls.__dict__.get('__annotations__', None)``).

In some versions of Python, instances of classes may have an ``__annotations__``
attribute.Thisis not supported functionality, so the best practice is to always
interact with the ``__annotations__`` attributeof an instance'stype. For example
``type(myinstance).__annotations__``.
attribute.However, thisis not supported functionality. If you need the
annotationsof an instance, you can use :func:`type` to access its class
(for example, ``annotationlib.get_annotations(type(myinstance))`` on Python 3.14+).
Loading

[8]ページ先頭

©2009-2025 Movatter.jp