(start, stop, step)
| 8 | |
| 9 | # pure Python implementations (3 args only), for comparison |
| 10 | def 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 | |
| 19 | def pyrange_reversed(start, stop, step): |
| 20 | stop += (start - stop) % step |
no outgoing calls
no test coverage detected
searching dependent graphs…