MCPcopy Index your code
hub / github.com/python/cpython / parse_keys

Function parse_keys

Lib/_pyrepl/keymap.py:108–115  ·  view source on GitHub ↗

Parse keys in keyspec format to a sequence of keys.

(keys: str)

Source from the content-addressed store, hash-verified

106
107
108def parse_keys(keys: str) -> list[str]:
109 """Parse keys in keyspec format to a sequence of keys."""
110 s = 0
111 r: list[str] = []
112 while s < len(keys):
113 k, s = _parse_single_key_sequence(keys, s)
114 r.extend(k)
115 return r
116
117
118def _parse_single_key_sequence(key: str, s: int) -> tuple[list[str], int]:

Callers 9

test_single_characterMethod · 0.90
test_keynamesMethod · 0.90
test_escape_sequencesMethod · 0.90
test_meta_sequencesMethod · 0.90
test_combinationsMethod · 0.90
test_keyspec_errorsMethod · 0.90
test_index_errorsMethod · 0.90
__init__Method · 0.85

Calls 2

extendMethod · 0.45

Tested by 8

test_single_characterMethod · 0.72
test_keynamesMethod · 0.72
test_escape_sequencesMethod · 0.72
test_meta_sequencesMethod · 0.72
test_combinationsMethod · 0.72
test_keyspec_errorsMethod · 0.72
test_index_errorsMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…