[issue1491804] Simple slice support for list.sort() and .reverse()

Raymond Hettinger report at bugs.python.org
Thu Aug 12 11:53:34 CEST 2010


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

I'm rejecting this feature request on the grounds that the use cases are sufficiently uncommon to warrant adding API complexity.  

Currently, the notions of reverse() and sort() are comparatively simple.  They correspond well to what I see in other languages.

Another issue is orthogonality, keeping the notions of slicing separate from concerns about sorting and reversing.

Also, the optimization aspect of this feature request is misguided (trying to reduce an O(n) step embedded inside an O(n log n) operation.

The purported syntactic gain is also negligible and uncompelling.
The rare bit of code that currently is written:

  sorted(s[a:b], key=f)

would instead become:

  sorted(s, key=f, start=a, stop=b)

There is no significant syntactic win or gain in expressiveness.

----------
resolution:  -> rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1491804>
_______________________________________


More information about the Python-bugs-list mailing list