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

Function current_expression_attribute

bpython/line.py:274–282  ·  view source on GitHub ↗

If after a dot, the attribute being completed

(
    cursor_offset: int, line: str
)

Source from the content-addressed store, hash-verified

272
273
274def current_expression_attribute(
275 cursor_offset: int, line: str
276) -> LinePart | None:
277 """If after a dot, the attribute being completed"""
278 # TODO replace with more general current_expression_attribute
279 for m in _current_expression_attribute_re.finditer(line):
280 if m.start(1) <= cursor_offset <= m.end(1):
281 return LinePart(m.start(1), m.end(1), m.group(1))
282 return None
283
284
285def cursor_on_closing_char_pair(

Callers

nothing calls this directly

Calls 3

LinePartClass · 0.85
finditerMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected