[issue11011] More functools functions

2013-10-04 Thread Piotr Dobrogost
Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net: -- nosy: +piotr.dobrogost ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11011 ___ ___

[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: - enhancement

[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

[issue11011] More functools functions

2011-01-26 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

[issue11011] More functools functions

2011-01-26 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

[issue11011] More functools functions

2011-01-25 Thread Jason Baker
New submission from Jason Baker amnorv...@gmail.com: 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

[issue11011] More functools functions

2011-01-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

[issue11011] More functools functions

2011-01-25 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

[issue11011] More functools functions

2011-01-25 Thread Jason Baker
Jason Baker amnorv...@gmail.com 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

[issue11011] More functools functions

2011-01-25 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com 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

[issue11011] More functools functions

2011-01-25 Thread Jason Baker
Jason Baker amnorv...@gmail.com 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