Files
Taus ac23e16786 Python: Move Python 3.15 data-flow tests to a separate file
We won't be able to run these tests until Python 3.15 is actually out
(and our CI is using it), so it seemed easiest to just put them in their
own test directory.
2026-04-17 13:16:46 +00:00

26 lines
671 B
Python

# PEP 798: Unpacking in comprehensions.
# These desugar to `yield from`, so flow depends on yield-from support.
def test_star_list_comp():
l = [[SOURCE]]
flat = [*x for x in l]
SINK(flat[0]) # $ MISSING:flow="SOURCE, l:-2 -> flat[0]"
def test_star_set_comp():
l = [[SOURCE]]
flat = {*x for x in l}
SINK(flat.pop()) # $ MISSING:flow="SOURCE, l:-2 -> flat.pop()"
def test_star_genexp():
l = [[SOURCE]]
g = (*x for x in l)
SINK(next(g)) # $ MISSING:flow="SOURCE, l:-2 -> next()"
def test_star_dictcomp():
l = [{"key": SOURCE}]
merged = {**d for d in l}
SINK(merged["key"]) # $ MISSING:flow="SOURCE, l:-2 -> merged[..]"