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

Function remove_comment_lines

mypyc/test/testutil.py:201–212  ·  view source on GitHub ↗

Return a copy of array with comments removed. Lines starting with '--' (but not with '---') are removed.

(a: list[str])

Source from the content-addressed store, hash-verified

199
200
201def remove_comment_lines(a: list[str]) -> list[str]:
202 """Return a copy of array with comments removed.
203
204 Lines starting with '--' (but not with '---') are removed.
205 """
206 r = []
207 for s in a:
208 if s.strip().startswith("--") and not s.strip().startswith("---"):
209 pass
210 else:
211 r.append(s)
212 return r
213
214
215def print_with_line_numbers(s: str) -> None:

Callers 6

run_caseMethod · 0.90
run_caseMethod · 0.90
run_caseMethod · 0.90
run_caseMethod · 0.90
run_caseMethod · 0.90
run_caseMethod · 0.90

Calls 3

stripMethod · 0.80
appendMethod · 0.80
startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…