On 2/5/10 11:51 AM, Ed Leafe wrote:
> On Feb 5, 2010, at 2:49 PM, Ed Leafe wrote:
>
>> They are more memory-efficient, because you don't have to create a complete 
>> copy of the list, as you would in a list comp.
>
>
>       I clicked 'send' before I wrote the main point: the efficiency gain in 
> my example isn't list comp vs. genexp; it's adding the filter to the 
> expression instead of iterating through potentially thousands of equality 
> tests.

You are in effect iterating through all of them in the list comp anyway. I 
break and 
return upon finding a match.

Paul


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to