Skip to content

Commit e8bdea8

Browse files
committed
PEP 728: Minor fixes
Noticed some small issues while adapting this PEP to the typing spec.
1 parent 61ff60e commit e8bdea8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

peps/pep-0728.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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
733733
still 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

747747
Runtime behavior

0 commit comments

Comments
 (0)