Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:verizon.net': 0.07; 'terry': 0.07; '>>>>': 0.09; 'changed;': 0.09; 'deliberately': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'statement.': 0.09; 'subject:Function': 0.09; 'am,': 0.13; 'wrote:': 0.15; 'reedy': 0.16; 'subject:function': 0.16; 'pm,': 0.16; '>>>': 0.16; 'def': 0.16; 'jan': 0.19; 'posting': 0.21; 'so.': 0.22; 'header:In-Reply- To:1': 0.22; 'subject: -- ': 0.25; 'testing': 0.25; 'saying': 0.26; "i'm": 0.27; 'do.': 0.30; 'colon': 0.30; 'subject:?': 0.31; 'changes': 0.31; "skip:' 10": 0.32; 'too': 0.32; 'to:addr:python- list': 0.34; 'header:X-Complaints-To:1': 0.34; 'header:User- Agent:1': 0.34; 'couple': 0.34; 'agree': 0.35; 'statement,': 0.35; 'addresses': 0.36; 'but': 0.37; 'received:org': 0.38; 'subject:: ': 0.38; 'two': 0.38; 'header:Mime-Version:1': 0.39; 'got': 0.39; 'to:addr:python.org': 0.39; 'factory': 0.73; '02:59': 0.84; 'subject:over': 0.84; 'typos': 0.84; 'mistakes': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Partial Function Application -- Advantages over normal function? Date: Tue, 19 Jul 2011 12:47:14 -0400 References: <201107181543.42229.kurianmthayil@gmail.com> <1405042.q1RDiLHYyK@PointedEars.de> <4E25576E.6050300@ieee.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 In-Reply-To: <4E25576E.6050300@ieee.org> 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311094202 news.xs4all.nl 23957 [2001:888:2000:d::a6]:55534 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9888 On 7/19/2011 6:07 AM, Dave Angel wrote: > On 01/-10/-28163 02:59 PM, Thomas 'PointedEars' Lahn wrote: >> Dave Angel wrote: >> >>> On 01/-10/-28163 02:59 PM, Terry Reedy wrote: >>>> def makeadder(y) >>>> def _add(x): return x+y >>>> add2 = makeadder(2) >>> A couple of typos in that code: >>> >>> >>> def makeaddr(y): >>> def _add(x): return x+y >>> return _add >> I agree about the `return' statement, but not about the factory name; >> this >> has nothing to do with addresses (addr). >> > > The two changes that I made deliberately were adding the colon and > adding the return statement. I'm not sure how the name got changed; that > was accidental. Anyway, my apologies for posting quickly without testing and without saying so. I know better and too often leave in mistakes when I do. -- Terry Jan Reedy