From ncoghlan at gmail.com Sat Jul 1 09:47:03 2006 From: ncoghlan at gmail.com (Nick Coghlan) Date: Sat, 01 Jul 2006 17:47:03 +1000 Subject: [Doc-SIG] First draft of Functional HOWTO In-Reply-To: <20060630215723.GA16013@rogue.amk.ca> References: <20060630215723.GA16013@rogue.amk.ca> Message-ID: <44A62877.6010203@gmail.com> A.M. Kuchling wrote: > I'd greatly appreciate comments on it. It still feels somehow > incomplete, like more of the general material is needed, but I'm not > sure what to add. It reads pretty well to me. One question on the documentation of list comps - is the choice to leave out the fact that you can insert filter expressions at any level in a list comp with multiple for clauses deliberate? The sorting URL needs updating, too: http://wiki.python.org/moin/HowTo/Sorting Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org From lameiro at gmail.com Sat Jul 1 19:29:35 2006 From: lameiro at gmail.com (Leandro Lameiro) Date: Sat, 1 Jul 2006 14:29:35 -0300 Subject: [Doc-SIG] First draft of Functional HOWTO In-Reply-To: <20060630215723.GA16013@rogue.amk.ca> References: <20060630215723.GA16013@rogue.amk.ca> Message-ID: <6815022a0607011029n227add4wc6eb1e94dd20fc74@mail.gmail.com> Hello amk. I've a few comments to your Functional Programming HOWTO. It is only a few typos, the text is really good. Here it goes: 1 - In the code sample below the text "You can figure it out, but it takes time" ... there is: def combine (a, b): return 0, a[1] + b[1] return reduce(combine_freq, items)[1] the first parameter to reduce should read combine, not combine_freq (or the def combine should read def combine_freq), right? 2 - At Small functions and the lambda statement section: "Which alternative is preferable? That's a style question; my general view is to avoid it." I'm not a native english speaker, but, avoiding what? The style question, the def or the lambda? 3 - Below Fredrik Lundh comments about refactoring lambdas: "I really like these rules, but you're free todisagree that this style is better." to disagree. there is a blank space missing. 4 - in the first code sample of the same section: " stripped_lines = [line.strip for line in lines] existing_files = filter(os.path.exists, file_list) " shouldn't it read stripped_lines = [line.strip() for line in lines]? Or you really want a list of "built-in method strip"? That's it. The text is very good! Congratulations. -- Regards Leandro Lameiro Blog: http://lameiro.redirectme.net/blog On 6/30/06, A.M. Kuchling wrote: > I've finally completed a first draft of a Functional Programming HOWTO > that discusses the language feature and modules that are useful > in functional-style programs. > > The draft is at ; this > won't be its permanent home, because once it's done it'll go in > Doc/howto/ in the distribution. > > I'd greatly appreciate comments on it. It still feels somehow > incomplete, like more of the general material is needed, but I'm not > sure what to add. > > I wrote a small but nontrivial functional program as an example -- > it's in sandbox/Doc in SVN -- but I'm not sure dissecting an example > is very useful. The resulting section would be fairly long, and I > haven't come up with an example that exercises every single feature > (e.g. most of the \ functions in the itertools module). > > A more minor issue: perhaps the HOWTO should describe genexps in > detail, and mention listcomps as an aside; this would be the oppposite > of how it's currently organized. Thoughts? > > --amk > _______________________________________________ > Doc-SIG maillist - Doc-SIG at python.org > http://mail.python.org/mailman/listinfo/doc-sig >