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

Function declare_variable

Tools/cases_generator/tier2_generator.py:40–48  ·  view source on GitHub ↗
(
    var: StackItem, uop: Uop, seen: set[str], out: CWriter
)

Source from the content-addressed store, hash-verified

38
39
40def declare_variable(
41 var: StackItem, uop: Uop, seen: set[str], out: CWriter
42) -> None:
43 if not var.used or var.name in seen:
44 return
45 seen.add(var.name)
46 type, null = type_and_null(var)
47 space = " " if type[-1].isalnum() else ""
48 out.emit(f"{type}{space}{var.name};\n")
49
50
51def declare_variables(uop: Uop, out: CWriter) -> None:

Callers 1

declare_variablesFunction · 0.70

Calls 4

type_and_nullFunction · 0.90
isalnumMethod · 0.80
addMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…