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

Function _get_lineno_width

Lib/dis.py:873–883  ·  view source on GitHub ↗
(linestarts)

Source from the content-addressed store, hash-verified

871_NO_LINENO = ' --'
872
873def _get_lineno_width(linestarts):
874 if linestarts is None:
875 return 0
876 maxlineno = max(filter(None, linestarts.values()), default=-1)
877 if maxlineno == -1:
878 # Omit the line number column entirely if we have no line number info
879 return 0
880 lineno_width = max(3, len(str(maxlineno)))
881 if lineno_width < len(_NO_LINENO) and None in linestarts.values():
882 lineno_width = len(_NO_LINENO)
883 return lineno_width
884
885def _get_positions_width(code):
886 # Positions are formatted as 'LINE:COL-ENDLINE:ENDCOL ' (note trailing space).

Callers 2

disassembleFunction · 0.85
disMethod · 0.85

Calls 3

strFunction · 0.85
filterFunction · 0.70
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…