Skip to content
Merged
Changes from 1 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
Prev Previous commit
Next Next commit
Mention get_annotations() early
  • Loading branch information
Viicos committed Jan 13, 2026
commit 8cc9875d1ca15aed972b0805cea9adaace7b7126
7 changes: 2 additions & 5 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3333,8 +3333,8 @@ Introspection helpers
Return a dictionary containing type hints for a function, method, module
or class object.

This is often the same as ``obj.__annotations__``, but this function makes
the following changes to the annotations dictionary:
This is often the same as :func:`annotationlib.get_annotations`, but this
function makes the following changes to the annotations dictionary:

* Forward references encoded as string literals or :class:`ForwardRef`
objects are handled by evaluating them in *globalns*, *localns*, and
Expand All @@ -3357,9 +3357,6 @@ Introspection helpers
with ``T``, unless *include_extras* is set to ``True`` (see
:class:`Annotated` for more information).

See also :func:`annotationlib.get_annotations`, a lower-level function that
returns annotations more directly.

.. caution::

This function may execute arbitrary code contained in annotations.
Expand Down
Loading