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

Function pyrange

Lib/test/test_range.py:10–17  ·  view source on GitHub ↗
(start, stop, step)

Source from the content-addressed store, hash-verified

8
9# pure Python implementations (3 args only), for comparison
10def pyrange(start, stop, step):
11 if (start - stop) // step < 0:
12 # replace stop with next element in the sequence of integers
13 # that are congruent to start modulo step.
14 stop += (start - stop) % step
15 while start != stop:
16 yield start
17 start += step
18
19def pyrange_reversed(start, stop, step):
20 stop += (start - stop) % step

Callers 2

pyrange_reversedFunction · 0.85
test_range_iteratorsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…