[issue11011] More functools functions

2013-10-04 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue11011] More functools functions

2013-05-19 Thread R. David Murray
R. David Murray added the comment: By my reading compose was also rejected, so I'm going to close this. (See issue 1506122 for one previous rejection of compose.) -- nosy: +r.david.murray resolution: -> rejected stage: -> committed/rejected status: open -> closed type: -> enhancemen

[issue11011] More functools functions

2013-05-12 Thread Mark Lawrence
Mark Lawrence added the comment: To summarize flip, const and identity won't happen, trampoline needs an external recipe or blog post and compose is the only one that's likely to happen. Opinions please gentlemen. -- nosy: +BreamoreBoy ___ Python t

[issue11011] More functools functions

2011-01-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm intrigued by the tampoline() but after reading Nick's post, I think it needs to be an external recipe or blog post with extensive examples so that it can mature and either prove its worth or serve as an intellectually stimulating toy. --

[issue11011] More functools functions

2011-01-26 Thread Nick Coghlan
Nick Coghlan added the comment: How the conversion from a recursive algorithm to an iterative one works depends on the specific algorithm involved. A trampoline does the job for tail calls, but not necessarily any other recursive algorithm. Factorial actually has a fairly trivial iterative al

[issue11011] More functools functions

2011-01-25 Thread Jason Baker
Jason Baker added the comment: I'm not sure I understand how Raymond's alternative for trampoline works. Let's take the factorial algorithm from wikipedia's page on tail recursion[1]. I've implemented the tail recursive version of the algorithm in Python using trampoline: from functool

[issue11011] More functools functions

2011-01-25 Thread Nick Coghlan
Nick Coghlan added the comment: For flip, const and identity I agree there are already better ways to handle them using either itertools or comprehension syntax. The problem I have with trampoline is that it depends on the function's *return values* being defined in a certain way (i.e. return

[issue11011] More functools functions

2011-01-25 Thread Jason Baker
Jason Baker added the comment: Ray, thanks for prompt and thorough feedback. To address your concerns: * I'm fine with doing away with const and identity (long story short I haven't really used them in functional languages anyway). There were reasons for defining identity the way it is, bu

[issue11011] More functools functions

2011-01-25 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue11011] More functools functions

2011-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought: The use of list comprehensions (a.k.a. list displays) and generator expressions has made many functional tools less necessary than ever. # preferred over map(pow, repeat(2), range(5)) [pow(2, x) for x in range(5)] # preferred o

[issue11011] More functools functions

2011-01-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Some of these have been proposed and rejected before. Compose has a problematic API because the traditional order of application in mathematics is counter-intuitive for many people. Const seems reasonable except that we already have ways to do it: t

[issue11011] More functools functions

2011-01-25 Thread Jason Baker
New submission from Jason Baker : I've created a patch that adds some common functional programming tools to functools. I've made the patch to work against Python 3.2, but that may be a bit aggressive. If so, then I can adapt it to work with 3.3. I also wouldn't be opposed to writing some of