Partially evaluated functions

Alex Martelli aleaxit at yahoo.com
Wed Jun 20 17:47:46 EDT 2001


"Nick Perkins" <nperkins7 at home.com> wrote in message
news:VL5Y6.296349$eK2.60381920 at news4.rdc1.on.home.com...
    ...
> I tested your solution, the cookbook version, and Alex's nested_scopes
> version.
> All three work properly for the kwd args tests that I performed.
    ...
> # by Rainer Deyke
> class curry_RD:
    [snip: 8 LOCs]
> # by Scott David Daniels (from cookbook)
> class curry_CB:
    [snip: 11 LOCs]
> # by Alex Martelli
> # (using nested_scopes)
> def curry_AM(func, *args, **kwds):
    [snip: 4 LOCs]

Interesting.  Given the compactness it affords for such tasks as
currying, maybe scope nesting ain't so bad after all.  It could be
worth placing a comment on Scott's CB entry, since the various
alternative techniques need to be considered...


Alex






More information about the Python-list mailing list