MCPcopy Index your code
hub / github.com/python/cpython / check_unused

Function check_unused

Tools/cases_generator/analyzer.py:365–374  ·  view source on GitHub ↗

Unused items cannot be on the stack above used, non-peek items

(stack: list[StackItem], input_names: dict[str, lexer.Token])

Source from the content-addressed store, hash-verified

363 return StackItem(item.name, item.size)
364
365def check_unused(stack: list[StackItem], input_names: dict[str, lexer.Token]) -> None:
366 "Unused items cannot be on the stack above used, non-peek items"
367 seen_unused = False
368 for item in reversed(stack):
369 if item.name == "unused":
370 seen_unused = True
371 elif item.peek:
372 break
373 elif seen_unused:
374 raise analysis_error(f"Cannot have used input '{item.name}' below an unused value on the stack", input_names[item.name])
375
376
377def analyze_stack(

Callers 1

analyze_stackFunction · 0.85

Calls 1

analysis_errorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…