list.sort()

Rikard Bosnjakovic bos at hack.org
Mon Jun 18 09:01:05 CEST 2001


Martin von Loewis wrote:

> Now, some people might expect sort and reverse to return a *new*
> array. That would be more expensive in many cases. Plus, changing it
> *now* is not appropriate: it would break code that expects that .sort
> sorts inplace, whereas a method that returns a new object would not
> sort the object itself.

I'm aware that changing is not a good idea at all. How about adding two
extra methods for sort/reverse, that actually returns the list instead
of changes it inplace?

I think changing the list in place is very unPythonic.


-- 
Rikard Bosnjakovic - http://bos.hack.org/cv/ - ICQ: 1158217

Anyone sending unwanted advertising e-mail to my address will be
charged $250 for network traffic and computing time. By extracting my
address from this message or its header, you agree to these terms.



More information about the Python-list mailing list