Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12769

Re: Closures and Partial Function Application

From Piet van Oostrum <piet@vanoostrum.org>
Newsgroups comp.lang.python
Subject Re: Closures and Partial Function Application
Date 2011-09-05 16:23 +0200
Message-ID <m2sjobf4pv.fsf@cochabamba.vanoostrum.org> (permalink)
References <9cd48486-acd9-4888-9677-0e54fd1eedfd@k15g2000yqd.googlegroups.com>

Show all headers | View raw


Travis Parks <jehugaleahsa@gmail.com> writes:

> I also like partial function application. What is the easiest way of
> achieving this in Python? Would it look something like this:
>
> def foo(x, y):
>     return x + y
>
> xFoo = lambda y: foo(10, y)

from functools import partial
xfoo = partial(foo, 10)
-- 
Piet van Oostrum <piet@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Closures and Partial Function Application Travis Parks <jehugaleahsa@gmail.com> - 2011-08-31 09:45 -0700
  Re: Closures and Partial Function Application Arnaud Delobelle <arnodel@gmail.com> - 2011-08-31 17:55 +0100
  Re: Closures and Partial Function Application Chris Rebert <clp2@rebertia.com> - 2011-08-31 10:18 -0700
    Re: Closures and Partial Function Application Travis Parks <jehugaleahsa@gmail.com> - 2011-08-31 10:51 -0700
      Re: Closures and Partial Function Application Travis Parks <jehugaleahsa@gmail.com> - 2011-08-31 11:02 -0700
        Re: Closures and Partial Function Application Ian Kelly <ian.g.kelly@gmail.com> - 2011-08-31 12:18 -0600
          Re: Closures and Partial Function Application Travis Parks <jehugaleahsa@gmail.com> - 2011-08-31 11:26 -0700
  Re: Closures and Partial Function Application "bruno.desthuilliers@gmail.com" <bruno.desthuilliers@gmail.com> - 2011-08-31 11:03 -0700
    Re: Closures and Partial Function Application Travis Parks <jehugaleahsa@gmail.com> - 2011-08-31 12:33 -0700
  Re: Closures and Partial Function Application Terry Reedy <tjreedy@udel.edu> - 2011-08-31 18:21 -0400
  Re: Closures and Partial Function Application Piet van Oostrum <piet@vanoostrum.org> - 2011-09-05 16:23 +0200

csiph-web