MCPcopy Index your code
hub / github.com/RustPython/RustPython / _get_lineno_width

Function _get_lineno_width

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

Source from the content-addressed store, hash-verified

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

Callers 2

disassembleFunction · 0.85
disMethod · 0.85

Calls 5

maxFunction · 0.85
filterFunction · 0.85
lenFunction · 0.85
strFunction · 0.85
valuesMethod · 0.45

Tested by

no test coverage detected