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

Method delete

Lib/idlelib/sidebar.py:387–401  ·  view source on GitHub ↗
(self, index1, index2=None)

Source from the content-addressed store, hash-verified

385 self.callback()
386
387 def delete(self, index1, index2=None):
388 if index2 is None:
389 index2 = index1 + "+1c"
390 is_single_line = get_lineno(self, index1) == get_lineno(self, index2)
391 if is_single_line:
392 before_displaylines = get_displaylines(self, index1)
393
394 self.delegate.delete(index1, index2)
395
396 if is_single_line:
397 after_displaylines = get_displaylines(self, index1)
398 if after_displaylines == before_displaylines:
399 return # no need to update the sidebar
400
401 self.callback()
402
403
404class ShellSidebar(BaseSideBar):

Callers

nothing calls this directly

Calls 4

get_linenoFunction · 0.85
get_displaylinesFunction · 0.85
deleteMethod · 0.45
callbackMethod · 0.45

Tested by

no test coverage detected