question on list comprehensions

Darren Dale dd55 at cornell.edu
Thu Oct 14 17:03:28 CEST 2004


Darren Dale wrote:

> Fredrik Lundh wrote:
> 
>> Darren Dale wrote:
>> 
>>> I need to replace the following loop with a list comprehension:
>>>
>>> res=[0]
>>> for i in arange(10000):
>>>     res[0]=res[0]+i
>> 
>> why?
>> 
>> </F>
> 
> I explained why in the original post...


or I guess I just implied it. The speedup is critical.



More information about the Python-list mailing list