[issue7153] add "start" arg to max and min functions

2009-10-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the thoughtful reply. To give the idea another chance, today, I showed a code example to another experienced programmer. "What does this function return? max([-2, 5], start=0) " The person had a hard time making any sense of it. Perhaps the

[issue7153] add "start" arg to max and min functions

2009-10-17 Thread paul rubin
paul rubin added the comment: 1. Yes, the idea is to figure out the best solution and go with it (or decide to do nothing). That many possibilities exist just points to the need for experience and wisdom in identifying the best choice ("one and preferably only one"). One of the attractive poin

[issue7153] add "start" arg to max and min functions

2009-10-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Here’s a summary of my research so far (including discussion with other programmers, a Google code search, discussion on #python-dev on IRC, and comparing the proposal to other APIs with start-arguments such as sum(), reduce(), and enumerate()): 1. Showed se

[issue7153] add "start" arg to max and min functions

2009-10-16 Thread R. David Murray
R. David Murray added the comment: Sorry, that "in case you don't remember' was directed at Raymond, not you. Since Raymond took ownership of this issue I don't think he's dismissing it (at least not yet :) I think his YAGNI was for the 'default' version, which is not what you are proposing.

[issue7153] add "start" arg to max and min functions

2009-10-16 Thread Ehsan Amiri
Changes by Ehsan Amiri : -- nosy: +esam ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/m

[issue7153] add "start" arg to max and min functions

2009-10-16 Thread paul rubin
paul rubin added the comment: David, I'm not on that mailing list so hadn't seen the earlier discussion. I sympathasize with Raymond's YAGNI argument because I'm comfortable with reduce(max,seq,0); but then I remember there was once a movement to remove the "reduce" function from builtins, whic

[issue7153] add "start" arg to max and min functions

2009-10-16 Thread R. David Murray
R. David Murray added the comment: In case you don't remember it, this thread from python-ideas is relevant: http://mail.python.org/pipermail/python-ideas/2009-April/004107.html I can't tell from rereading the thread whether the support was for the 'initial' version, or the 'default' version t

[issue7153] add "start" arg to max and min functions

2009-10-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger versions: +Python 2.7, Python 3.2 -Python 2.5 ___ Python tracker ___ _

[issue7153] add "start" arg to max and min functions

2009-10-16 Thread paul rubin
Changes by paul rubin : -- type: -> feature request ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue7153] add "start" arg to max and min functions

2009-10-16 Thread paul rubin
New submission from paul rubin : Lots of times I want to find the largest element of a list or sequence, defaulting to 0 if the list or sequence is empty. max(seq) throws an exception if seq is empty, so I end up using reduce(max, seq, 0). That is a standard functional programming idiom but can