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

Function collapse_line_continuation

mypy/test/data.py:522–532  ·  view source on GitHub ↗
(l: list[str])

Source from the content-addressed store, hash-verified

520
521
522def collapse_line_continuation(l: list[str]) -> list[str]:
523 r: list[str] = []
524 cont = False
525 for s in l:
526 ss = re.sub(r"\\$", "", s)
527 if cont:
528 r[-1] += re.sub("^ +", "", ss)
529 else:
530 r.append(ss)
531 cont = s.endswith("\\")
532 return r
533
534
535def expand_variables(s: str) -> str:

Callers 1

parse_test_dataFunction · 0.85

Calls 2

appendMethod · 0.80
endswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…