[Python-3000] range() issues
Facundo Batista
facundobatista at gmail.com
Sat Apr 26 13:50:55 CEST 2008
2008/4/26, Benjamin Peterson <musiccomposition at gmail.com>:
> First of all, should the length of range be completely constricted by
> Py_ssize_t? (issue 2690) Since indexing already is constrained by
> this, it would make sense to make the whole object live under that
What is range()?
help(range) shows me that range "Returns an iterator that generates
the numbers in the range on demand."
Ahá! So, as ints are unbound in Python, I could easily do:
>>> r = range(1,1000000000000000000000)
*If* range() provides me the indexing facility (a nice feature to
have, but in any means core to this function), it should allow me to
index it completely, or at least, to Py_ssize_t. IOW, r[0] should
work, even if r[9999999999999999999) doesn't.
That is, to me, the range semantics that we should aim to.
Regards,
--
. Facundo
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
More information about the Python-3000
mailing list