Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.04; 'received:verizon.net': 0.07; 'returned.': 0.07; 'terry': 0.07; 'python': 0.08; '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; 'subject:python': 0.12; 'am,': 0.13; 'wrote:': 0.15; 'closures': 0.16; 'functools': 0.16; 'iterators,': 0.16; 'reedy': 0.16; 'style,': 0.16; 'subject: \n ': 0.16; 'subject:topic': 0.16; 'protocol': 0.16; 'programming': 0.18; 'functions,': 0.19; 'jan': 0.19; 'input': 0.21; 'java': 0.21; 'header:In-Reply-To:1': 0.22; 'objects,': 0.23; 'format,': 0.25; 'mainly': 0.26; 'work.': 0.28; 'example': 0.30; 'module': 0.30; 'anthony': 0.30; 'functional': 0.31; 'subject:?': 0.31; 'developers': 0.32; 'topic': 0.33; 'to:addr:python-list': 0.34; 'header:X-Complaints-To:1': 0.34; 'header:User-Agent:1': 0.34; 'there': 0.34; 'e.g.': 0.34; 'starting': 0.35; 'languages.': 0.35; 'received:org': 0.38; 'takes': 0.38; 'subject:: ': 0.38; 'think': 0.38; 'common': 0.39; 'should': 0.39; 'header:Mime-Version:1': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'subject:will': 0.64; 'concept': 0.73; 'subject:have': 0.74; 'subject:this': 0.74; 'subject:you': 0.81; 'colleagues': 0.84; 'hole': 0.84; 'kong': 0.84; 'notion': 0.84; 'trick.': 0.84; 'vastly': 0.84; 'technique': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Functional style programming in python: what will you talk about if you have an hour on this topic? Date: Wed, 13 Jul 2011 12:29:50 -0400 References: <2b28da74-f054-4f46-8971-43603ab7cfd3@glegroupsg2000goo.googlegroups.com> 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: <2b28da74-f054-4f46-8971-43603ab7cfd3@glegroupsg2000goo.googlegroups.com> 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310574602 news.xs4all.nl 23978 [2001:888:2000:d::a6]:57779 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9411 On 7/13/2011 8:39 AM, Anthony Kong wrote: > I am giving a few presentations on python to my colleagues who are mainly java developers and starting to pick up python at work. > > > So I have picked this topic for one of my presentation. It is because functional programming technique is one of my favorite in my bag of python trick. It also takes me to the rabbit hole of the functional programming world, which is vastly more interesting than the conventional procedural/OO languages. > > > I think I will go through the following items: > > itertools module The iteration protocol and the notion of iteraables as the common data exchange format, with associated notions of iterators, generator functions, and generators, are important features of Python. Not really functional style, I guess. > functools module > concept of currying ('partial') > > > I would therefore want to ask your input e.g. > > Is there any good example to illustrate the concept? > What is the most important features you think I should cover? Functions are first-class objects, like everything else. Use of closures to create functions to be returned. -- Terry Jan Reedy