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

Function names_approx_match

mypy/stubtest.py:812–815  ·  view source on GitHub ↗
(a: str, b: str)

Source from the content-addressed store, hash-verified

810 return
811
812 def names_approx_match(a: str, b: str) -> bool:
813 a = a.strip("_")
814 b = b.strip("_")
815 return a.startswith(b) or b.startswith(a) or len(a) == 1 or len(b) == 1
816
817 # Be more permissive about names matching for positional-only arguments
818 if runtime_arg.kind == inspect.Parameter.POSITIONAL_ONLY and names_approx_match(

Callers 1

_verify_arg_nameFunction · 0.85

Calls 3

lenFunction · 0.85
stripMethod · 0.80
startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…