From: Bartosz Sławecki Date: Tue, 13 Jan 2026 13:52:29 +0000 (+0100) Subject: gh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (#143702) X-Git-Tag: v3.15.0a5~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=865eb12e07bb483de6ce2cc52c5a59665fe81cd1;p=thirdparty%2FPython%2Fcpython.git gh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (#143702) --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 73236413cbb8..eaa0ba54af18 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -2369,7 +2369,7 @@ These functions and classes should not be used directly as annotations. Their intended purpose is to be building blocks for creating and declaring types. -.. function:: NamedTuple +.. class:: NamedTuple Typed version of :func:`collections.namedtuple`. @@ -2589,7 +2589,7 @@ types. for more details. -.. function:: TypedDict +.. class:: TypedDict(dict) Special construct to add type hints to a dictionary. At runtime ":class:`!TypedDict` instances" are simply :class:`dicts `.