2008/4/24, "Martin v. Löwis" <[EMAIL PROTECTED]>:

>  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 "<stdin>", line 1, in <module>
>  >     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
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to