PEP 572: Assignments not narrowed in right-hand side of and #7313
Labels
bug
mypy got something wrong
priority-1-normal
topic-pep-572
PEP 572 (walrus operator)
topic-strict-optional
The binder interaction doesn't work properly for assignments in the right-hand side of an
and
(afterif x and (y := 1):
, the type ofy
isn't narrowed toint
).Test case:
(Currently it produces
Revealed type is 'Union[builtins.int, None]'
instead.)Followup from #6899
The text was updated successfully, but these errors were encountered: