File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -726,8 +726,8 @@ with signatures matching ``dict[str, VT]``
726726 reveal_type(not_required_num_dict.popitem()) # OK. Revealed type is 'tuple[str, int]'
727727
728728 def f(not_required_num_dict: IntDictWithNum, key: str):
729- not_required_num_dict[key] = 42 # OK
730- del not_required_num_dict[key] # OK
729+ not_required_num_dict[key] = 42 # OK
730+ del not_required_num_dict[key] # OK
731731
732732:ref: `Notes on indexed accesses <pep728-type-narrowing >` from the previous section
733733still apply.
@@ -741,7 +741,7 @@ because such dict can be a subtype of dict::
741741 def f(might_not_be_a_builtin_dict: dict[str, int]):
742742 int_dict: IntDict = might_not_be_a_builtin_dict # Not OK
743743
744- not_a_builtin_dict: CustomDict = {"num": 1}
744+ not_a_builtin_dict = CustomDict( {"num": 1})
745745 f(not_a_builtin_dict)
746746
747747Runtime behavior
You can’t perform that action at this time.
0 commit comments