Sorting out sort (Re: Python vs. Ruby)
johnroth at ameritech.net
Fri Jan 3 15:29:54 CET 2003
"Anders J. Munch" <andersjm at dancontrol.dk> wrote in message
news:3e144c3a$0$71645$edfadb0f at dread11.news.tele.dk...
> "John Roth" <johnroth at ameritech.net> wrote:
> > > How about adding this to the library somewhere?
> > This version unfortunately doesn't allow chained application. - it's
> > a functional version.
> It was intended to be a purely functional version. It doesn't chain,
> but then it doesn't need to. Say we add a functional reverse also:
> def reverse(sequence):
> """reverse a sequence, returning a new list"""
> reversed = list(sequence)
> return reversed
> print reverse(sort([1,4,2,3]))
> What more do you need?
Something that chains properly.
> - Anders
More information about the Python-list