The binder interaction doesn't work properly for assignments in the right-hand side of an and (after if x and (y := 1):, the type of y isn't narrowed to int).
Test case:
[case testAndRHS]
from typing import Optional
def f(x: Optional[int], y: Optional[int]) -> None:
if x and (y := 1):
reveal_type(y) # N: Revealed type is 'builtins.int'
(Currently it produces Revealed type is 'Union[builtins.int, None]' instead.)
Followup from #6899
The binder interaction doesn't work properly for assignments in the right-hand side of an
and(afterif x and (y := 1):, the type ofyisn't narrowed toint).Test case:
(Currently it produces
Revealed type is 'Union[builtins.int, None]'instead.)Followup from #6899