Jl2Py
Documentation for Jl2Py.
Jl2Py.__parse_range
— MethodParse a Julia range (leading by :(:)).
We modify the end when all args are Integer
s. For example:
1:3
becomesrange(1, 4)
1:5:11
becomesrange(1, 12, 5)
1:-5:-9
becomesrange(1, -10, -5)
We also modify the end when the step is implicit (=1). For example:
a:b
becomesrange(a, b + 1)
This might cause problems in such cases as 1.5:1.8
, but since Python only supports integer-indexed implicit ranges, we do not consider such edge cases here.