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

Function _format_range_unified

Lib/difflib.py:1085–1094  ·  view source on GitHub ↗

Convert range to the "ed" format

(start, stop)

Source from the content-addressed store, hash-verified

1083########################################################################
1084
1085def _format_range_unified(start, stop):
1086 'Convert range to the "ed" format'
1087 # Per the diff spec at http://www.unix.org/single_unix_specification/
1088 beginning = start + 1 # lines start numbering with one
1089 length = stop - start
1090 if length == 1:
1091 return '{}'.format(beginning)
1092 if not length:
1093 beginning -= 1 # empty ranges begin at line just before the range
1094 return '{},{}'.format(beginning, length)
1095
1096def unified_diff(a, b, fromfile='', tofile='', fromfiledate='',
1097 tofiledate='', n=3, lineterm='\n'):

Callers 1

unified_diffFunction · 0.85

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected