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