PEP 728: Wording updates for clarity in certain sections (#3724)

This commit is contained in:
Zixuan Li 2024-03-16 09:29:41 -04:00 committed by GitHub
parent 326a658a17
commit 8a25d5d3ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 6 deletions

View File

@ -654,9 +654,9 @@ because such dict can be a subtype of dict::
How to Teach This
=================
The choice of ``"__extra_items__"`` and the requirement of ``closed=True``
whenever it is used as a special key intended to make it more understandable to
new users even without former knowledge of this feature.
The choice of the spelling ``"__extra_items__"`` is intended to make this
feature more understandable to new users compared to shorter alternatives like
``"__extra__"``.
Details of this should be documented in both the typing spec and the
:mod:`typing` documentation.
@ -701,9 +701,10 @@ subtyping. ``closed=True`` plays a similar role in the current proposal.
Supporting ``TypedDict(extra=type)``
------------------------------------
While this design is potentially viable, there are several partially addressable
concerns to consider. The author of this PEP thinks that it is slightly less
favorable than the current proposal.
During the discussion of the PEP, there were strong objections against adding
another place where types are passed as values instead of annotations from some
authors of type checkers. While this design is potentially viable, there are
also several partially addressable concerns to consider.
- Usability of forward reference
As in the functional syntax, using a quoted type or a type alias will be