diff --git a/peps/pep-0728.rst b/peps/pep-0728.rst index b89f8b79824..fcc019c94d9 100644 --- a/peps/pep-0728.rst +++ b/peps/pep-0728.rst @@ -335,7 +335,7 @@ extra items:: name: str def f(movie: Movie) -> None: - del movie["name"] # Not OK. The value type of 'name' is 'Required[int]' + del movie["name"] # Not OK. The value type of 'name' is 'Required[str]' del movie["year"] # OK. The value type of 'year' is 'NotRequired[int]' Interaction with ``Unpack`` @@ -726,8 +726,8 @@ with signatures matching ``dict[str, VT]`` reveal_type(not_required_num_dict.popitem()) # OK. Revealed type is 'tuple[str, int]' def f(not_required_num_dict: IntDictWithNum, key: str): - not_required_num_dict[key] = 42 # OK - del not_required_num_dict[key] # OK + not_required_num_dict[key] = 42 # OK + del not_required_num_dict[key] # OK :ref:`Notes on indexed accesses ` from the previous section still apply. @@ -741,7 +741,7 @@ because such dict can be a subtype of dict:: def f(might_not_be_a_builtin_dict: dict[str, int]): int_dict: IntDict = might_not_be_a_builtin_dict # Not OK - not_a_builtin_dict: CustomDict = {"num": 1} + not_a_builtin_dict = CustomDict({"num": 1}) f(not_a_builtin_dict) Runtime behavior