-
-
Notifications
You must be signed in to change notification settings - Fork 656
Open
Description
Python 2 had range
(returning lists) and xrange
(returning iterators).
Python 3 only has range
which behaves like the old xrange
.
This ticket is to rename or change our range-like functions accordingly.
To go further we could make sure they all follow similar semantics, i.e.:
f(a)
for the range from0
included toa
excludedf(a, b)
for the range froma
included tob
excludedf(a, b, c)
for the range froma
included tob
excluded, by steps ofc
Functions in the global name space:
ellipsis_range
fibonacci_xrange
mrange
mrange_iter
prime_range
randrange
range
srange
sxrange
xmrange
xmrange_iter
xsrange
See also:
- prime_range should allow a step #29760:
prime_range
should allow a step - Meta-ticket: improve compatibility with the Python library and Python packages #29728: Meta-ticket: improve compatibility with the Python library
- py3: need to fix sequence of ranges #24543: py3: need to fix sequence of ranges
- prime_range vs primes #18298:
prime_range
vsprimes
- Add more examples for when srange is better than range #17373: Add more examples for when
srange
is better thanrange
- Deprecate sage.misc.mrange.*mrange* and cartesian_product_iterator #34337: Deprecate
sage.misc.mrange.*mrange*
andcartesian_product_iterator
CC: @slel @tscrim @fchapoton
Component: python3
Keywords: range
Branch/Commit: public/srange_as_iterator @ 3cee22e
Issue created by migration from https://trac.sagemath.org/ticket/30121