[Python-Dev] decorate-sort-undecorate
Guido van Rossum
guido at python.org
Tue Oct 14 10:37:44 EDT 2003
> I've got a first draft patch (sans docs and tests) loaded at:
> www.python.org/sf/823292
No time to review, so feedback just on this email. :-(
> The argument keywords are: cmpfunc, key, reverse
I'd suggest using 'cmp' instead of 'cmpfunc'. (Same argument as for
'key' vs. 'keyfunc'.)
> The patch passes regression tests and a minimal set of basic
> functionality tests which need to be expanded considerably. I'll need
> to go back over this one in more detail to check:
>
> * Whether the code was inserted in the right place with respect to the
> existing anti-mutation code.
>
> * Is the strategy of decorating in-place too aggressive? Decoration
> consists of *replacing* each value x with (x, key(x)).
Should be fine. AFAIR Tim's sort code sets the length of the list to
0, so accessing the list while it's being sorted is not supported
anyway.
> * Verify reference counting and error handling.
Write unit tests and measure process size.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list