[sapug] Excellent presentation on generators

Chris Foote chris at inetd.com.au
Thu Mar 20 05:32:44 CET 2008


On Thu, 20 Mar 2008, Daryl Tester wrote:

> Chris Foote wrote:
>
>> I've never really thought of a use for generators, but this presentation
>> at PyCon 2008 certainly changes my mind:
>
> It certainly explains them a little more clearly (maybe it's the
> "sysadmin" focus of the examples).  I got to some point during
> the "pipelines" potion and thought "Ooo - lisp streams".

The generator expressions are amazingly powerful for the idea
of making producers and filters to be consumed.  I love the guy's
example of log processing from multiple sources and custom queries
using filters.

I haven't looked at Common LISP streams yet...  The language is so big
that you can study it for ages and not scratch the surface :-)

> Still
> working my way through the examples, but thanks for that link.

I've been playing with Lua lately, and its co-routines make my brain
hurt :-)  The end of the PyCon presentation gets into co-routines,
which I think might be in Python 3000.  I haven't made up my mind
whether they're good or not.

> Decorators still don't come naturally to me - have to stare at them
> for a while before the light clicks (instead of just going 'Aha!'
> and moving on).

I've only used them for @staticmethod in the past.  I need to find some
good examples of what you can do with them before I know how they're
really useful.

Chris Foote <chris at inetd.com.au>
Inetd Pty Ltd T/A HostExpress
Web:   http://www.hostexpress.com.au
Blog:  http://www.hostexpress.com.au/drupal/chris
Phone: (08) 8410 4566


More information about the sapug mailing list