Skip to content

Commit

Permalink
Add cover note to consistency section
Browse files Browse the repository at this point in the history
Make it clear that the new consistency rules should match the existing rules for any types not using the new features.
  • Loading branch information
alicederyn committed Sep 23, 2023
1 parent 1c533b5 commit 3dc4d20
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions peps/pep-0705.rst
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ Finally, subclasses can have ``other_keys=Never`` even if the superclass does no
Type consistency
----------------

*This section updates the type consistency rules introduced in :pep:`589` to cover the new features in this PEP. In particular, any pair of types that do not use the new features will be consistent under these new rules if (and only if) they were already consistent.*

A TypedDict type with ``other_keys=Never`` is consistent with ``Mapping[str, V]``, where ``V`` is the union of all its value types. For instance, the following type is consistent with ``Mapping[str, int | str]``::

class Person(TypedDict, other_keys=Never):
Expand Down

0 comments on commit 3dc4d20

Please sign in to comment.