Użytkownik Paul McNett napisał:
> On 9/23/10 10:26 AM, Ed Leafe wrote:
>    
>> On Sep 23, 2010, at 12:32 PM, Jacek Kałucki wrote:
>>      
>>> Could you show me an example, where current iterator
>>> approach is better than Python approach, please?
>>>        
>>
>>      [biz.Record.sales_amount for rec in biz.bizIterator()
>>              if biz.Record.stateprov == "NJ"]
>>      
> Trivial nit: since rec isn't a Record object but a record number I think it is
> clearer to say:
>
>       [biz.Record.sales_amount for idx in biz.bizIterator()
>               if biz.Record.stateprov == "NJ"]
>
>    

You really see difference? Because I don't.
This is the point! The rec/idx could be whatever, since it's not used at 
all here.
You could even return from 'next()' string like 'Dabo rule over the world!'
on each iteration.
Why iterator returns something useless while it can return something 
usefull?

-- 
Regards
Jacek Kałucki

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

Reply via email to