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

Oren Leaffer oren at ephemeron-labs.com
Tue Mar 13 19:08:47 UTC 2012


> 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!


Best regards,


Oren




More information about the bitbake-devel mailing list