MCPcopy Index your code
hub / github.com/bpython/bpython / current_dict

Function current_dict

bpython/line.py:98–103  ·  view source on GitHub ↗

If in dictionary completion, return the dict that should be used

(cursor_offset: int, line: str)

Source from the content-addressed store, hash-verified

96
97
98def current_dict(cursor_offset: int, line: str) -> LinePart | None:
99 """If in dictionary completion, return the dict that should be used"""
100 for m in _current_dict_re.finditer(line):
101 if m.start(2) <= cursor_offset <= m.end(2):
102 return LinePart(m.start(1), m.end(1), m.group(1))
103 return None
104
105
106_current_string_re = LazyReCompile(

Callers

nothing calls this directly

Calls 3

LinePartClass · 0.85
finditerMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected