https://github.com/python/cpython/commit/d3bd245c732339fdcc050dd5c9dc070f96767075
commit: d3bd245c732339fdcc050dd5c9dc070f96767075
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: AlexWaygood <[email protected]>
date: 2026-01-11T15:59:14Z
summary:

[3.14] gh-86139: Correct NamedTuple and TypedDict's type in typing.rst 
(GH-143692) (#143696)

Co-authored-by: AN Long <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>

files:
M Doc/library/typing.rst

diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 360a0af0ee4e5b..c5e8af0b5a4a73 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -2355,7 +2355,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.
 
-.. class:: NamedTuple
+.. function:: NamedTuple
 
    Typed version of :func:`collections.namedtuple`.
 
@@ -2428,6 +2428,10 @@ types.
       Removed the ``_field_types`` attribute in favor of the more
       standard ``__annotations__`` attribute which has the same information.
 
+   .. versionchanged:: 3.9
+      ``NamedTuple`` is now a function rather than a class.
+      It can still be used as a class base, as described above.
+
    .. versionchanged:: 3.11
       Added support for generic namedtuples.
 
@@ -2584,10 +2588,10 @@ types.
       for more details.
 
 
-.. class:: TypedDict(dict)
+.. function:: TypedDict
 
    Special construct to add type hints to a dictionary.
-   At runtime it is a plain :class:`dict`.
+   At runtime ":class:`!TypedDict` instances" are simply :class:`dicts <dict>`.
 
    ``TypedDict`` declares a dictionary type that expects all of its
    instances to have a certain set of keys, where each key is
@@ -2810,6 +2814,10 @@ types.
 
    .. versionadded:: 3.8
 
+   .. versionchanged:: 3.9
+      ``TypedDict`` is now a function rather than a class.
+      It can still be used as a class base, as described above.
+
    .. versionchanged:: 3.11
       Added support for marking individual keys as :data:`Required` or 
:data:`NotRequired`.
       See :pep:`655`.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to