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

R. David Murray report at bugs.python.org
Thu Sep 23 03:04:33 CEST 2010

R. David Murray <rdmurray at bitdance.com> added the comment:

In fact, I find the proposed syntax *less* obvious than the slice syntax, for sorted.  IOW, I'd be -1 on adding these to sorted.  The potentially useful case is between

    l[a:b] = sorted(l[a:b})


    l.sort(start=a, stop=b)

where the interesting bit is that the sort takes place in place (no memory copy).

I still find the slice syntax clearer :), and it's not clear that the savings of the memory copy for a few programs that use it is worth the added complexity for all other programs.  So I concur with Raymond's rejection.

nosy: +r.david.murray

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list