A Universe Set

Peter Otten __peter__ at web.de
Wed Oct 4 17:59:33 CEST 2006


Jean-Paul Calderone wrote:

> On Wed, 04 Oct 2006 11:00:28 -0400, Leif K-Brooks <eurleif at ecritters.biz>
> wrote:
>>Jorgen Grahn wrote:
>>> - infinite xrange()s
>>
>>itertools.count()?
> 
> Not quite:
> 
>     >>> import sys, itertools
>     >>> c = itertools.count(sys.maxint)
>     >>> c.next()
>     2147483647
>     >>> c.next()
>     -2147483648
>     >>> 
> 
> Jean-Paul

>>> import sys
>>> from itertools import count
>>> c = count(sys.maxint)
>>> c.next()
2147483647
>>> c.next()
2147483648L

sys.maxint and then some cheers on Python 2.5 :-)

Peter



More information about the Python-list mailing list