Re: [Python-3000] Using range() 2008/4/24, "Martin v. LÃ¶wis" :

>  The advanced way of invoking some method on the object (i.e. emulating
>  the for loop) is to first create an iterator from the range object.
>  You can't consume the range itself: it will always contain the same
>  numbers - just like you can't consume a list.

Great! Thanks!

>>> r = range(10000000000000000000)
>>> it = iter(r)
>>> it.__next__()
0
>>> it.__next__()
1


>  >>>> r = range(10000000000000000000)
>  >>>> r[0]
>  > Traceback (most recent call last):
>  >   File "", line 1, in 
>  >     OverflowError: Python int too large to convert to C ssize_t
>  >
>  > This is a bug, right?
>
> I'd call it an implementation limitation.

This is because I'm in a 32 bit machine?

>>> n = 10000000000000000000
>>> 2**32 > n
False
>>> 2**64 > n
True

Should it work in a 64 bit hardware?

Thanks again!

-- 
    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
_______________________________________________
Python-3000 mailing list
smsbmo-9552@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: http://mail.python.org/mailman/options/python-3000/python-3000%40tangomu.com



