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

Function strip_comments

mypy/stubtest.py:2322–2326  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

2320
2321def get_allowlist_entries(allowlist_file: str) -> Iterator[str]:
2322 def strip_comments(s: str) -> str:
2323 try:
2324 return s[: s.index("#")].strip()
2325 except ValueError:
2326 return s.strip()
2327
2328 with open(allowlist_file) as f:
2329 for line in f:

Callers 1

get_allowlist_entriesFunction · 0.85

Calls 2

stripMethod · 0.80
indexMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…