Author Julian
Recipients Julian, r.david.murray, twouters
Date 2013-06-02.01:42:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1370137326.04.0.450954321428.issue18111@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for finding that, I thought there was an issue that came out of that p-i thread but couldn't find it.

I'd like to be more concrete, but "calling max on an iterable" seems concrete enough to me. If you'd like to know more though, personally I've wanted this at least twice in the past 4 or 5 months. Currently, I have code that looks like:

    def best_match(stuff):
        first = next(stuff, None)
        if first is None:
            return
        return max(itertools.chain([first], stuff))

which finds the best matching (error it happens to be) in the given stuff. A few months ago I had a similar need in a different application.

The issues in that thread from 2009 revolved around a bunch of confusing and not so related things. And I definitely agree that `start` is a really bad name for this. But I don't find `default` to be at all confusing, and in fact this has come up in #python a few times and each time there hasn't really been a problem explaining to someone what `default` would do (or how it would interact with `key` for that matter, although if a precedent is desired, the default in `argparse` just returns the default, it doesn't call `type` or anything on it).
History
Date User Action Args
2013-06-02 01:42:06Juliansetrecipients: + Julian, twouters, r.david.murray
2013-06-02 01:42:06Juliansetmessageid: <1370137326.04.0.450954321428.issue18111@psf.upfronthosting.co.za>
2013-06-02 01:42:05Julianlinkissue18111 messages
2013-06-02 01:42:01Juliancreate