list.sort, was Re: [Python-Dev] decorate-sort-undecorate

Charles Cazabon python at discworld.dyndns.org
Wed Oct 15 17:28:32 EDT 2003


Kevin J. Butler <python-kbutler at sabaydi.com> wrote:
> 
> I think just about everyone gets tripped up by the "sort returns None" 
> behavior, and though one (e.g., BDFL) can declare that it is a less 
> significant stumble than not realizing the list is sorted in place, it 
> is a _continuing_ inconvenience, with virtually every call to [].sort, 
> even for Python experts (like Barry, not me).

Sure.  I regularly find myself wishing "foo.sort().reverse()" and similar
constructions would work, even in-place.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon                           <python at discworld.dyndns.org>
GPL'ed software available at:     http://www.qcc.ca/~charlesc/software/
-----------------------------------------------------------------------



More information about the Python-Dev mailing list