From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 13 Jan 2026 13:58:14 +0000 (+0100) Subject: [3.13] gh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (GH-14370... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dd9afcf9170c5639bcc372a756e409e285d367c;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (GH-143702) (#143800) Co-authored-by: Bartosz Sławecki --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 4384707dc399..23e7b1ac9789 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -2257,7 +2257,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`. @@ -2486,7 +2486,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 `.