]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (#143702)
authorBartosz Sławecki <bartosz@ilikepython.com>
Tue, 13 Jan 2026 13:52:29 +0000 (14:52 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Jan 2026 13:52:29 +0000 (13:52 +0000)
Doc/library/typing.rst

index 73236413cbb80f2b4749558f3c1570b069b4ec9b..eaa0ba54af18e750cbdb87610ba442cd264b1639 100644 (file)
@@ -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 <dict>`.