[Python-ideas] New list methods

Greg Ewing greg.ewing at canterbury.ac.nz
Thu May 7 02:37:33 CEST 2009


steve at pearwood.info wrote:

> What other built-in functions take a bool param to select between 
> different functionality? sorted() is a special case.

Another thing about sort() is that reversed=True is
equivalent to passing a key function that results
in reversed ordering, so it's easy to see it as a
parameterization of the existing behaviour.

That's not the case with index() and remove() --
there's nothing you can pass to the existing methods
that will cause them to operate in reverse.

-- 
Greg




More information about the Python-ideas mailing list