fix(narrowing): propagate walrus narrowing from inside `and` expressions (closes #19430) by traveltamers · Pull Request #21147 · python/mypy

and others added 4 commits

April 2, 2026 12:17
Add _collect_walrus_type_map to TypeChecker that recursively walks arbitrary expression trees collecting AssignmentExpr type narrowings. Call it in find_isinstance_check_helper's "and" branch to register walrus assignments from the right operand into the true-branch type map.
…erand

Add regression tests for walrus operator behavior in nested expressions.