https://github.com/python/cpython/commit/865eb12e07bb483de6ce2cc52c5a59665fe81cd1
commit: 865eb12e07bb483de6ce2cc52c5a59665fe81cd1
branch: main
author: Bartosz Sławecki <[email protected]>
committer: AlexWaygood <[email protected]>
date: 2026-01-13T13:52:29Z
summary:
gh-143728: Keep `TypedDict` and `NamedTuple` in `class` role in docs (#143702)
files:
M Doc/library/typing.rst
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 73236413cbb80f..eaa0ba54af18e7 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 <dict>`.
_______________________________________________
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]