Do this as a list comprehension?

John Salerno johnjsal at gmailNOSPAM.com
Sun Jun 8 22:40:39 EDT 2008


Mensanator wrote:
> On Jun 8, 3:19�am, "Terry Reedy" <tjre... at udel.edu> wrote:
>> "Mensanator" <mensana... at aol.com> wrote in message
>>
>> news:8d7c0912-422f-4480-a034-078f9dbcae24 at 2g2000hsn.googlegroups.com...
>> | On Jun 7, 6:43?pm, "Terry Reedy" <tjre... at udel.edu> wrote:
>> | > zip(range(9,2000000000), iterable)
>> |
>> | Oh, dear. You didn't actually try this, did you?
>>
>> Works fine in Py3, which is what I use now.
> 
> You really ARE cruel to the newbies, aren't you?
> 
> Don't you think it would have been appropriate
> to attach a large red label: WARNING! PY3!

Heh heh, don't worry. Every time I see a range function, I immediately 
think "creates a list". Not sure how I got into that habit, but it 
happens every time! :)



More information about the Python-list mailing list