From 4c75e86a517d83ab7955b949f500a57d92b01baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Tue, 13 Jan 2026 14:52:29 +0100 Subject: [PATCH] gh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (GH-143702) (cherry picked from commit 865eb12e07bb483de6ce2cc52c5a59665fe81cd1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartosz Sławecki --- Doc/library/typing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 4384707dc39907..23e7b1ac97891d 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 `.