gh-105566: Deprecate unusual ways of creating `typing.NamedTuple` classes by AlexWaygood · Pull Request #105609 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good cleanup!
| return '<sentinel>' | ||
|
|
||
|
|
||
| _sentinel = _Sentinel() |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that = object() is good enough for this case.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree. Using = object() would mean that the displayed signature would be very ugly if somebody did help(typing.NamedTuple) in the REPL
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we'll be able to reuse the _Sentinel class when we do #105570 :)
AlexWaygood
changed the title
gh-105566: Deprecate unusual ways of constructing
gh-105566: Deprecate unusual ways of creating typing.NamedTuplestyping.NamedTuple classes