[bitbake-devel] [PATCH 1/3] Hob: implement a self-defined notebook visual component for Hob

Joshua Lock josh at linux.intel.com
Tue Mar 13 19:23:51 UTC 2012



On 13/03/12 12:08, Oren Leaffer wrote:
>> 1) We're doing the range dance rather than just doing the Pythonic thing and
>> iterating over the sequence with "for x in y".
>> http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#use-in-where-possible-1
>>
>> I understand its desirable to have the index in some places, but where it
>> isn't we should use the standard pattern. This is good coding practice.
>
> I think I pointed it out before, but it was on a Friday, so I might as
> well repeat -
>
> If you need the index you can replace something like this:
>    for i in range(len(self.children)): # ugly
> With:
>    for i,child in enumerate(self.children): # less ugly!

Indeed, I'd be happy to see more of that.

Thanks for pointing that out Oren!

Cheers,
Joshua
-- 
Joshua '贾詡' Lock
         Yocto Project "Johannes factotum"
         Intel Open Source Technology Centre




More information about the bitbake-devel mailing list