"bob gailer" <[EMAIL PROTECTED]> wrote

>> That's sad to see, I use range to generate lists of integers
>> almost as much as I use it for iteration. 

> FWIW on my computer
> l = range(30000000) takes under 0.19 seconds
> l = list(xrange(3000000)) under 0.27.
> So I don't think performance is an issue.

Performance was never an issue for me, its just that I think 
the explicit conversion to list looks ugly. After all a range is 
a range of numbers to my mind and a list (actually a tuple) 
seems like the sensible representation. Making it an iterator 
seems to be based on an assumption that range will 
primarily be used in a for loop.

Alan G

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to