File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ extra items::
336336 name: str
337337
338338 def f(movie: Movie) -> None:
339- del movie["name"] # Not OK. The value type of 'name' is 'Required[int ]'
339+ del movie["name"] # Not OK. The value type of 'name' is 'Required[str ]'
340340 del movie["year"] # OK. The value type of 'year' is 'NotRequired[int]'
341341
342342Interaction with ``Unpack ``
@@ -727,8 +727,8 @@ with signatures matching ``dict[str, VT]``
727727 reveal_type(not_required_num_dict.popitem()) # OK. Revealed type is 'tuple[str, int]'
728728
729729 def f(not_required_num_dict: IntDictWithNum, key: str):
730- not_required_num_dict[key] = 42 # OK
731- del not_required_num_dict[key] # OK
730+ not_required_num_dict[key] = 42 # OK
731+ del not_required_num_dict[key] # OK
732732
733733:ref: `Notes on indexed accesses <pep728-type-narrowing >` from the previous section
734734still apply.
@@ -742,7 +742,7 @@ because such dict can be a subtype of dict::
742742 def f(might_not_be_a_builtin_dict: dict[str, int]):
743743 int_dict: IntDict = might_not_be_a_builtin_dict # Not OK
744744
745- not_a_builtin_dict: CustomDict = {"num": 1}
745+ not_a_builtin_dict = CustomDict( {"num": 1})
746746 f(not_a_builtin_dict)
747747
748748Runtime behavior
You can’t perform that action at this time.
0 commit comments