[Python-Dev] decorate-sort-undecorate

Michael Chermside mcherm at mcherm.com
Thu Oct 16 08:17:44 EDT 2003


Tim writes:
> That said, since we're having a fire sale on optional sort arguments in 2.4,
> I wouldn't oppose an optional Boolean argument you could explicit set to
> have x.sort() return x.  For example,

I just wanted to call everyone's attention to the fact that Tim may
(again... <sigh>) have come up with a decent idea.

Seriously... Guido (and apparently Tim and I too) insist that aList.sort()
must return None since it mutates the list. Meanwhile, Kevin, Barry, and
perhaps others want to be able to write aList.sort().reverse().chainMoreHere().

But both sides could probably be happy with:

    aList.sort(chain=True).reverse()

Right?

-- Michael Chermside




More information about the Python-Dev mailing list