gh-105566: Deprecate unusual ways of creating typing.NamedTuple classes#105609
Merged
AlexWaygood merged 3 commits intopython:mainfrom Jun 14, 2023
Merged
gh-105566: Deprecate unusual ways of creating typing.NamedTuple classes#105609AlexWaygood merged 3 commits intopython:mainfrom
typing.NamedTuple classes#105609AlexWaygood merged 3 commits intopython:mainfrom
Conversation
sobolevn
reviewed
Jun 10, 2023
| return '<sentinel>' | ||
|
|
||
|
|
||
| _sentinel = _Sentinel() |
Member
There was a problem hiding this comment.
I think that = object() is good enough for this case.
Member
Author
There was a problem hiding this comment.
I disagree. Using = object() would mean that the displayed signature would be very ugly if somebody did help(typing.NamedTuple) in the REPL
Member
Author
There was a problem hiding this comment.
Also, we'll be able to reuse the _Sentinel class when we do #105570 :)
typing.NamedTuplestyping.NamedTuple classes
AlexWaygood
commented
Jun 14, 2023
Misc/NEWS.d/next/Library/2023-06-09-20-34-23.gh-issue-105566.YxlGg1.rst
Outdated
Show resolved
Hide resolved
JelleZijlstra
approved these changes
Jun 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #105566
typing.NamedTupleclasses #105566📚 Documentation preview 📚: https://cpython-previews--105609.org.readthedocs.build/