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

Method check_names

Tools/cases_generator/stack.py:586–593  ·  view source on GitHub ↗
(locals: list[Local])

Source from the content-addressed store, hash-verified

584
585 @staticmethod
586 def check_names(locals: list[Local]) -> None:
587 names: set[str] = set()
588 for var in locals:
589 if var.name == "unused":
590 continue
591 if var.name in names:
592 raise StackError(f"Duplicate name {var.name}")
593 names.add(var.name)
594
595 def sanity_check(self) -> None:
596 self.check_names(self.inputs)

Callers 1

sanity_checkMethod · 0.95

Calls 3

setFunction · 0.85
StackErrorClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected