MCPcopy Create free account
hub / github.com/bpython/bpython / cursor

Function cursor

bpython/test/test_line_properties.py:23–27  ·  view source on GitHub ↗

ab|c' -> (2, 'abc')

(s)

Source from the content-addressed store, hash-verified

21
22
23def cursor(s):
24 """'ab|c' -> (2, 'abc')"""
25 cursor_offset = s.index("|")
26 line = s[:cursor_offset] + s[cursor_offset + 1 :]
27 return cursor_offset, line
28
29
30def decode(s: str) -> tuple[tuple[int, str], LinePart | None]:

Callers 1

test_IMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected