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

Function format_key_list

mypy/messages.py:3492–3500  ·  view source on GitHub ↗
(keys: list[str], *, short: bool = False)

Source from the content-addressed store, hash-verified

3490
3491
3492def format_key_list(keys: list[str], *, short: bool = False) -> str:
3493 formatted_keys = [f'"{key}"' for key in keys]
3494 td = "" if short else "TypedDict "
3495 if len(keys) == 0:
3496 return f"no {td}keys"
3497 elif len(keys) == 1:
3498 return f"{td}key {formatted_keys[0]}"
3499 else:
3500 return f"{td}keys ({', '.join(formatted_keys)})"
3501
3502
3503def ignore_last_known_values(t: UnionType) -> Type:

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…