Python Generator Tricks
linuxgazette.net
linuxgazette.net
As a minor sidenote, I personally think 4 spaces for indentation makes the code more readable.
Why do you feel that 4 spaces is better than 5, which is usually the number of spaces represented by \t?
Still though, my question remains. Is there a particular reason you prefer 4? Does it affect your workflow in any way or does it just 'look better' in the abstract? I'm curious.
Linus disagrees: http://lxr.linux.no/linux+v2.6.35.7/Documentation/CodingStyl...
http://metaoptimize.com/blog/2009/12/22/why-cant-you-pickle-generators-in-python-workaround-pattern-for-saving-training-state/