MCPcopy
hub / github.com/Nuitka/Nuitka / functionWhileForListIterate

Function functionWhileForListIterate

tests/basics/NestedLoopsTest27.py:51–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50
51def functionWhileForListIterate():
52 data = [[1, 2, 3]]
53 collected = None
54 idx = 0
55 while idx < len(data):
56 for item in data[idx]:
57 if collected is None:
58 collected = []
59 collected.append(item)
60 idx += 1
61 out = []
62 if collected is not None:
63 for x in collected:
64 out.append(x)
65 print("while+for list iterate:", out)
66
67
68# for+for: None -> dict, iterate keys after nested loops

Callers 1

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…