From c7a2f07f45ce5d271509de8300dcb94cb0a97638 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 4 Oct 2025 16:05:02 +0100 Subject: [PATCH 1/2] [Docs] Add missing note about Required/NotRequired in get_type_hints() --- Doc/library/typing.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index e0122986e9ba3a..77c192bcac0c81 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -3340,7 +3340,8 @@ Introspection helpers ``__annotations__`` dictionaries. Annotations on classes appearing earlier in the :term:`method resolution order` always take precedence over annotations on classes appearing later in the method resolution order. - * The function recursively replaces all occurrences of ``Annotated[T, ...]`` + * The function recursively replaces all occurrences of + ``Annotated[T, ...]``/``Required[T]``/``NotRequired[T]`` with ``T``, unless *include_extras* is set to ``True`` (see :class:`Annotated` for more information). From 1ed68f29a7cd10406fda2aac900cd84814f12835 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 4 Oct 2025 16:10:37 +0100 Subject: [PATCH 2/2] Update Doc/library/typing.rst --- Doc/library/typing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 77c192bcac0c81..4fb1524c77c59e 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -3341,7 +3341,7 @@ Introspection helpers earlier in the :term:`method resolution order` always take precedence over annotations on classes appearing later in the method resolution order. * The function recursively replaces all occurrences of - ``Annotated[T, ...]``/``Required[T]``/``NotRequired[T]`` + ``Annotated[T, ...]``, ``Required[T]`` and ``NotRequired[T]`` with ``T``, unless *include_extras* is set to ``True`` (see :class:`Annotated` for more information).