[Python-Dev] RE: [Python-checkins] python/dist/src/Python bltinmodule.c, 2.304, 2.305

Raymond Hettinger python at rcn.com
Wed Dec 17 16:19:27 EST 2003

> > Guido grants a Christmas wish:
> >   sorted() becomes a regular function instead of a classmethod.

> Would sort() be a better name?  When I told someone who's done quite a
> bit of java recently about sorted, he asked if it returned a bool
> whether the list was sorted or not. :-)

I think sorted() is better:

* the context makes it clear that it's not a predicate
* the name helps distinguish it from list.sort()
* it fits with reversed()
* looking at actual code using sorted(), it reads well

my two cents,

Raymond Hettinger

More information about the Python-Dev mailing list