This won't work for builtin functions. It hardly works for functions
and methods defined in 3rd party modules and in no way for functions
defined in C extensions. It adds boilerplate statically to remove it
at runtime.
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 4, 10:11 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> This is nice.
Thanks.
> * I wouldn't choose '&' as the composing operator as when I read
> 'double & square' I think 'take an x, double it & square it' which is
> the wrong interpretation (perhaps << instead?).
A very good point t
On Feb 4, 3:00 pm, Dustan <[EMAIL PROTECTED]> wrote:
> On Feb 2, 11:09 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> [snip]
>
> While you're waiting for it to be implemented, you can build your own
> version as a decorator. Here's an example written in haste:
>
> >>> class composer(object):
>
>
On Feb 2, 11:09 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote:
[snip]
While you're waiting for it to be implemented, you can build your own
version as a decorator. Here's an example written in haste:
>>> class composer(object):
def __init__(self, *funcs):
self.funcs = funcs
On Feb 3, 11:34 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Feb 3, 12:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > As you know, there is no operator for function composition in Python.
> > When you have two functions F and G and want to express the
> > composition F o G you have to c
On Feb 3, 12:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> As you know, there is no operator for function composition in Python.
> When you have two functions F and G and want to express the
> composition F o G you have to create a new closure
>
> lambda *args, **kwd: F (G (*args, **kwd))
>
>
On 3 Feb., 10:55, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> On Feb 3, 9:43 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 3 Feb., 10:13, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
> > > On Feb 3, 5:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > > > As you know, there is no op
On Feb 3, 9:43 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On 3 Feb., 10:13, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Feb 3, 5:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > > As you know, there is no operator for function composition in Python.
> > > When you have two funct
On 3 Feb., 10:13, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> On Feb 3, 5:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
>
>
> > As you know, there is no operator for function composition in Python.
> > When you have two functions F and G and want to express the
> > composition F o G you have
On Feb 3, 5:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> As you know, there is no operator for function composition in Python.
> When you have two functions F and G and want to express the
> composition F o G you have to create a new closure
>
> lambda *args, **kwd: F (G (*args, **kwd))
>
> or
As you know, there is no operator for function composition in Python.
When you have two functions F and G and want to express the
composition F o G you have to create a new closure
lambda *args, **kwd: F (G (*args, **kwd))
or you write a composition in functional style
compose( F, G )
None of
11 matches
Mail list logo