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

Function get_lineno

Lib/idlelib/sidebar.py:15–18  ·  view source on GitHub ↗

Return the line number of an index in a Tk text widget.

(text, index)

Source from the content-addressed store, hash-verified

13
14
15def get_lineno(text, index):
16 """Return the line number of an index in a Tk text widget."""
17 text_index = text.index(index)
18 return int(float(text_index)) if text_index else None
19
20
21def get_end_linenumber(text):

Callers 6

init_shellMethod · 0.90
test_mousewheelMethod · 0.90
get_end_linenumberFunction · 0.85
deleteMethod · 0.85
update_sidebarMethod · 0.85

Calls 1

indexMethod · 0.45

Tested by 2

init_shellMethod · 0.72
test_mousewheelMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…