Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'bind': 0.09; 'subject:Function': 0.09; 'am,': 0.13; 'wrote:': 0.15; '12:22': 0.16; 'def.': 0.16; 'lambda': 0.16; 'received:192.168.1.40': 0.16; 'simplified': 0.16; 'subject:function': 0.16; 'anonymous': 0.16; '>>>': 0.16; 'def': 0.16; 'header:In-Reply-To:1': 0.22; 'tue,': 0.23; 'subject: -- ': 0.25; 'construct': 0.30; 'kelly': 0.30; 'subject:?': 0.31; 'to:addr:python-list': 0.34; 'header:User- Agent:1': 0.34; 'functions.': 0.37; 'received:192': 0.38; 'subject:: ': 0.38; 'received:192.168.1': 0.39; 'should': 0.39; 'to:addr:python.org': 0.39; 'making': 0.66; 'received:62': 0.67; 'from:addr:t': 0.84; 'subject:over': 0.84 Date: Tue, 19 Jul 2011 18:58:26 +0200 From: Thomas Jollans User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Iceowl/1.0b2 Icedove/3.1.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Partial Function Application -- Advantages over normal function? References: <201107181543.42229.kurianmthayil@gmail.com> <1405042.q1RDiLHYyK@PointedEars.de> <4247181.bSrEuok8ZT@PointedEars.de> <4E25228C.6000705@jollybox.de> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=5C8691ED Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311094712 news.xs4all.nl 23962 [2001:888:2000:d::a6]:43005 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9890 On 19/07/11 18:49, Ian Kelly wrote: > On Tue, Jul 19, 2011 at 12:22 AM, Thomas Jollans 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.