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


Groups > comp.lang.python > #9890

Re: Partial Function Application -- Advantages over normal function?

Date 2011-07-19 18:58 +0200
From Thomas Jollans <t@jollybox.de>
Subject Re: Partial Function Application -- Advantages over normal function?
References (3 earlier) <mailman.1232.1311025576.1164.python-list@python.org> <1405042.q1RDiLHYyK@PointedEars.de> <4247181.bSrEuok8ZT@PointedEars.de> <4E25228C.6000705@jollybox.de> <CALwzidmugMS-1cuFBrTKdA=VKctC27r=CL3N7v_DH=a0qQK03Q@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1260.1311094712.1164.python-list@python.org> (permalink)

Show all headers | View raw


On 19/07/11 18:49, Ian Kelly wrote:
> On Tue, Jul 19, 2011 at 12:22 AM, Thomas Jollans <t@jollybox.de> wrote:
>>> Supplemental: The above can be simplified to
>>>
>>> def makeadder(y): return lambda x: x + y
>>>
>>
>> In turn:
>>
>> makeadder = lambda y: lambda x: x + y
> 
> That's not an improvement.  lambda is for making anonymous functions.
> If you're going to construct a lambda and bind it to a name, you
> should just use def.

No, it's not an improvement. It's an illustration.

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


Thread

Re: Partial Function Application -- Advantages over normal function? Dave Angel <davea@ieee.org> - 2011-07-18 17:45 -0400
  Re: Partial Function Application -- Advantages over normal function? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-19 00:28 +0200
    Re: Partial Function Application -- Advantages over normal function? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-19 00:33 +0200
      Re: Partial Function Application -- Advantages over normal function? Thomas Jollans <t@jollybox.de> - 2011-07-19 08:22 +0200
      Re: Partial Function Application -- Advantages over normal function? Ian Kelly <ian.g.kelly@gmail.com> - 2011-07-19 10:49 -0600
      Re: Partial Function Application -- Advantages over normal function? Thomas Jollans <t@jollybox.de> - 2011-07-19 18:58 +0200
      Re: Partial Function Application -- Advantages over normal function? Ian Kelly <ian.g.kelly@gmail.com> - 2011-07-19 11:15 -0600
    Re: Re: Partial Function Application -- Advantages over normal function? Dave Angel <davea@ieee.org> - 2011-07-19 06:07 -0400
    Re: Partial Function Application -- Advantages over normal function? Terry Reedy <tjreedy@udel.edu> - 2011-07-19 12:47 -0400

csiph-web