Skip to content

Conversation

@johnslavik
Copy link
Member

@johnslavik johnslavik commented Jan 11, 2026

types.

.. function:: NamedTuple
.. class:: NamedTuple
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this one need to change? I don't think we have any attributes documented for NamedTuple with the .. attribute:: syntax

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. class:: NamedTuple
.. function:: NamedTuple

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if this changes in the future, and we would then need to change the type again? My only concern is that changing the type results in warnings/errors for anyone referencing NamedTuple in their docs, so maybe we need to be careful when changing such types.

First example that came to mind was the peps repo, with some hits for TypedDict: https://github.com/search?q=repo%3Apython%2Fpeps+%2F%3Aclass%3A%60%28%28%7E%29%3Ftyping%5C.%29%3FTypedDict%2F&type=code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure NamedTuple is likely to change, but I brought back the revert in 4244745.
It seems to me that status quo is a safer approach.

@johnslavik johnslavik changed the title gh-86139: Keep TypedDict and NamedTuple in class role in docs gh-86139: Keep TypedDict in class role in docs Jan 11, 2026
@johnslavik johnslavik changed the title gh-86139: Keep TypedDict in class role in docs gh-86139: Keep TypedDict and NamedTuple in class role in docs Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants