Re: An idea for fast function composition

2008-02-16 Thread castironpi
On Feb 16, 5:57 pm, Boris Borcic <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 16, 3:47 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > >> Hi all, > > >> Recently there was a thread about function composition in Python (and > >> this was probably not the first).  The fast way t

Re: An idea for fast function composition

2008-02-16 Thread Boris Borcic
[EMAIL PROTECTED] wrote: > On Feb 16, 3:47 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> Recently there was a thread about function composition in Python (and >> this was probably not the first). The fast way to create a >> (anonymous) composite function >> >> f1 o f2 o ...

Re: An idea for fast function composition

2008-02-16 Thread castironpi
> def compose( funcs ): >    def reccompose( *args ): >       return compose( funcs[:-1] )( funcs[-1]( *args ) ) if funcs else > funcs[0]( *args ) >    return reccompose- Hide quoted text - Which was, if funcs> 1, which is len( funcs )> 1. >>> [1]>0 Traceback (most recent call last): File "", li

Re: An idea for fast function composition

2008-02-16 Thread castironpi
On Feb 16, 3:47 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Hi all, > > Recently there was a thread about function composition in Python (and > this was probably not the first).  The fast way to create a > (anonymous) composite function > >      f1 o f2 o ... o fn > > in Python is via > >    

An idea for fast function composition

2008-02-16 Thread Arnaud Delobelle
Hi all, Recently there was a thread about function composition in Python (and this was probably not the first). The fast way to create a (anonymous) composite function f1 o f2 o ... o fn in Python is via lambda x: f1(f2(...fn(x)...)), but according to some this is neither the most c