@@ -1818,6 +1818,44 @@ type YNested = (1 + (yield from [])) # E: Yield expression cannot be used within
18181818type ZNested = (1 + (a := 1)) # E: Named expression cannot be used within a type alias
18191819type KNested = (1 + (await 1)) # E: Await expression cannot be used within a type alias
18201820
1821+ [case testWalrusRebindsNamesLoadedInComprehensionTargets]
1822+ # Newly legal in https://github.com/python/cpython/pull/100581
1823+ from typing import Any
1824+
1825+ def f(c: Any, d: Any, e: Any, f: Any, g: Any, h: Any, j: Any) -> None:
1826+ ((c := 1) for a, (*b, c[d+e::f(g)], h.i) in j)
1827+ [(c := 1) for a, (*b, c[d+e::f(g)], h.i) in j]
1828+ {(c := 1) for a, (*b, c[d+e::f(g)], h.i) in j}
1829+
1830+ ((d := 1) for a, (*b, c[d+e::f(g)], h.i) in j)
1831+ [(d := 1) for a, (*b, c[d+e::f(g)], h.i) in j]
1832+ {(d := 1) for a, (*b, c[d+e::f(g)], h.i) in j}
1833+
1834+ ((e := 1) for a, (*b, c[d+e::f(g)], h.i) in j)
1835+ [(e := 1) for a, (*b, c[d+e::f(g)], h.i) in j]
1836+ {(e := 1) for a, (*b, c[d+e::f(g)], h.i) in j}
1837+
1838+ ((f := 1) for a, (*b, c[d+e::f(g)], h.i) in j)
1839+ [(f := 1) for a, (*b, c[d+e::f(g)], h.i) in j]
1840+ {(f := 1) for a, (*b, c[d+e::f(g)], h.i) in j}
1841+
1842+ ((g := 1) for a, (*b, c[d+e::f(g)], h.i) in j)
1843+ [(g := 1) for a, (*b, c[d+e::f(g)], h.i) in j]
1844+ {(g := 1) for a, (*b, c[d+e::f(g)], h.i) in j}
1845+
1846+ ((h := 1) for a, (*b, c[d+e::f(g)], h.i) in j)
1847+ [(h := 1) for a, (*b, c[d+e::f(g)], h.i) in j]
1848+ {(h := 1) for a, (*b, c[d+e::f(g)], h.i) in j}
1849+
1850+ ((i := 1) for a, (*b, c[d+e::f(g)], h.i) in j)
1851+ [(i := 1) for a, (*b, c[d+e::f(g)], h.i) in j]
1852+ {(i := 1) for a, (*b, c[d+e::f(g)], h.i) in j}
1853+
1854+ ((j := 1) for a, (*b, c[d+e::f(g)], h.i) in j)
1855+ [(j := 1) for a, (*b, c[d+e::f(g)], h.i) in j]
1856+ {(j := 1) for a, (*b, c[d+e::f(g)], h.i) in j}
1857+ [builtins fixtures/primitives.pyi]
1858+
18211859[case testPEP695TypeAliasAndAnnotated]
18221860from typing_extensions import Annotated, Annotated as _Annotated
18231861import typing_extensions as t
0 commit comments