Is Python really slow?

Mike Fletcher mfletch at tpresence.com
Sat May 27 13:52:45 EDT 2000


>>> v = xrange( 0, sys.maxint )

As this does not require 8GB of memory (4bytes/int), I think you can be
assured that the list is not being created :) . You can deal with the xrange
as though it has created said array, but it's doing lazy evaluation under
the covers to delay creating the numbers until they are needed.

HTH,
Mike

-----Original Message-----
From: Makhno [mailto:mak at imakhno.freeserve.co.uk]
Sent: Saturday, May 27, 2000 12:49 PM
To: python-list at python.org
Subject: Re: Is Python really slow?


>I have implemented  loop in Python
>
>for k in xrange(1,100000000):
>   pass

Does xrange create an array of numbers 1...1e8?



-- 
http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list