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

Function tier_variable

Tools/cases_generator/analyzer.py:545–555  ·  view source on GitHub ↗

Determine whether a tier variable is used in a node.

(node: parser.CodeDef)

Source from the content-addressed store, hash-verified

543
544
545def tier_variable(node: parser.CodeDef) -> int | None:
546 """Determine whether a tier variable is used in a node."""
547 if isinstance(node, parser.LabelDef):
548 return None
549 for token in node.tokens:
550 if token.kind == "ANNOTATION":
551 if token.text == "specializing":
552 return 1
553 if re.fullmatch(r"tier\d", token.text):
554 return int(token.text[-1])
555 return None
556
557
558def has_error_with_pop(op: parser.CodeDef) -> bool:

Callers 1

compute_propertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…