MCPcopy Index your code
hub / github.com/python/mypy / gen_unique_name

Function gen_unique_name

mypy/checker.py:8709–8716  ·  view source on GitHub ↗

Generate a name that does not appear in table by appending numbers to base.

(base: str, table: SymbolTable)

Source from the content-addressed store, hash-verified

8707
8708
8709def gen_unique_name(base: str, table: SymbolTable) -> str:
8710 """Generate a name that does not appear in table by appending numbers to base."""
8711 if base not in table:
8712 return base
8713 i = 1
8714 while base + str(i) in table:
8715 i += 1
8716 return base + str(i)
8717
8718
8719def is_true_literal(n: Expression) -> bool:

Callers 1

Calls 1

strClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…