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

Function pretty_seq

mypy/messages.py:3389–3396  ·  view source on GitHub ↗
(args: Sequence[str], conjunction: str)

Source from the content-addressed store, hash-verified

3387
3388
3389def pretty_seq(args: Sequence[str], conjunction: str) -> str:
3390 quoted = ['"' + a + '"' for a in args]
3391 if len(quoted) == 1:
3392 return quoted[0]
3393 if len(quoted) == 2:
3394 return f"{quoted[0]} {conjunction} {quoted[1]}"
3395 last_sep = ", " + conjunction + " "
3396 return ", ".join(quoted[:-1]) + last_sep + quoted[-1]
3397
3398
3399def append_invariance_notes(

Calls 2

lenFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…