gh-86139: Correct NamedTuple and TypedDict's type in typing.rst#143692
Conversation
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
There was a problem hiding this comment.
Maybe we could additionally clarify the implications of this?
E.g. "NamedTuple is now a function that can be used as a class base. It is no longer a class, so it cannot be used with isinstance(), issubclass() and other routines that are expected to work for class objects" .
Similar for TypedDict.
(Prior to these changes isinstance() et al. would work).
I figured this while wondering if we could briefly say why these constructs are no longer classes, and that's what the explanations from GH-84366 and GH-84368 tell me would be the most fitting here.
|
Thanks @aisk for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…pythonGH-143692) (cherry picked from commit e22b685) Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…pythonGH-143692) (cherry picked from commit e22b685) Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
GH-143696 is a backport of this pull request to the 3.14 branch. |
|
GH-143697 is a backport of this pull request to the 3.13 branch. |
|
Thanks @aisk! |
|
This broke references to the
And so breaks Sphinx cross references. |
Ah, because functions cannot have attributes, according to Sphinx? That's too bad. Great catch @Viicos. @aisk, would you be able to make a PR reverting just the change from |
Yeah that might be it. I'm wondering if it would make sense to document them as |
Partially reverts pythonGH-143692; see python#143692 (comment)
Oops, I've read this right after making that PR #143702 |
That works for me if Sphinx renders it okay! |
|
Yeah |
…python#143692) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
…python#143692) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>


📚 Documentation preview 📚: https://cpython-previews--143692.org.readthedocs.build/