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
[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 ...
> 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
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
>
>
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