copysort patch, was RE: [Python-Dev] inline sort option

Mark Russell mrussell at verio.net
Sat Oct 18 05:44:35 EDT 2003


On Sat, 2003-10-18 at 07:07, Brett C. wrote:
> I'm -1 as well.  Lists do not need to grow a method for something that 
> only replaces two lines of code that are not tricky in any form of the word.

And don't forget that the trivial function will sort any iterable, not
just lists.  I think

	for member in copysort(someset):

is better than

	for member in list(someset).copysort():

I'm against list.copysort(), and for either leaving things unchanged or
adding copysort() as a builtin (especially if it can use the reference
count trick to avoid unnecessary copies).

Mark Russell

	





More information about the Python-Dev mailing list