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

Jeremy Fincher fincher.8 at osu.edu
Thu Dec 18 03:51:18 EST 2003


On Wednesday 17 December 2003 04:19 pm, Raymond Hettinger wrote:
> 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

sorted() returns a list, and reversed() returns an iterator.  That seems like 
a recipe for confusion, *especially* because they "fit" together and do 
completely different things.

Jeremy



More information about the Python-Dev mailing list