[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: (x)range( 40000000000, 40000000001 )
From:       aahz () pythoncraft ! com (Aahz)
Date:       2003-06-30 1:10:11
[Download RAW message or body]

In article <3eff347f$1@buckaroo.cs.rit.edu>,
Chris Connett  <kill_cxc_spam_0117@cs.rit.edu> wrote:
>
>It seems range and xrange don't like longs that can't be sqeezed into ints:
>
>With Python 2.3b1+:
>
> >>> xrange( 40000000000, 40000000001 )
>Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>OverflowError: long int too large to convert to int
> >>> range( 40000000000, 40000000001 )
>Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>OverflowError: long int too large to convert to int
> >>>

The first problem is that range is designed to create a list and the
canonical usage for range is range(N); lists cannot currently have more
than int elements.  xrange() could get away with fixing it, but Guido has
decreed that xrange() is a target for deprecation (and will go away in
Python 3.0), so he won't allow any improvements to xrange() in order to
encourage people to use alternatives.
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

Usenet is not a democracy.  It is a weird cross between an anarchy and a
dictatorship.  
-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic