From 5f38127ac2f7c2b7573ab1926aef339e5ec1a379 Mon Sep 17 00:00:00 2001 From: Evan Kohilas Date: Mon, 29 Jun 2026 17:43:54 +1000 Subject: [PATCH] Add clarity for version added for typing.Unpack typing.Unpack was added in version 3.11, but the ability to use it with TypedDict for `**kwargs` was added in 3.12. Currently, the positioning makes it look like using typing.Unpack with TypedDict was added in 3.11 --- Doc/library/typing.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index c909b8bad6d726c..13fb844e45e06d7 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1714,6 +1714,8 @@ These can be used as types in annotations. They all support subscription using tup: tuple[*Ts] # Syntax error on Python <= 3.10! tup: tuple[Unpack[Ts]] # Semantically equivalent, and backwards-compatible + .. versionadded:: 3.11 + ``Unpack`` can also be used along with :class:`typing.TypedDict` for typing ``**kwargs`` in a function signature:: @@ -1729,7 +1731,7 @@ These can be used as types in annotations. They all support subscription using See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing. - .. versionadded:: 3.11 + .. versionadded:: 3.12 Building generic types and type aliases """""""""""""""""""""""""""""""""""""""