Saturday 16 March 2013
I gave a talk yesterday at PyCon 2013 called
Loop Like a Native.
The main point was: write more generators. Give it a look.
Thanks for posting this. I picked up a few useful hints; particularly I'd missed the rather handy enumerate function. Also, I'll be thinking more of using generators to flatten nested loops into a single loop.
I really like your format for blog slides. So much more useful than just the slides, maybe even a video.
To loop one has to have iterable in the first place whereas often we get scalar value instead. That's why I find it useful to have this kind of "adapter":
if isinstance(input, empty_types):
if isinstance(input, scalar_types):
Superb article/talk. Thanks.