very good reasons?

Grant Griffin g2 at
Sat Sep 30 00:17:20 CEST 2000

In article <wkaecrf2ef.fsf at>, Dan says...
>Grant Griffin <g2 at> writes:
>| I would have expected sort and reverse to return the list in
>| question, but instead they return None.
>sort and reverse return None so you don't get fooled into thinking
>that they don't modify the list you passed in as an argument.
>If you could write
>  sorted_arr = arr.sort()
>then people might get surprised that arr changed.

Well, I had thought of that, but it didn't really seem compelling to me: I can't
find anything in Tim's "Python Philosophy"* that it specifically violates.

(unlike-some-of-2.0's-new-features-<wink>)-ly y'rs,



Grant R. Griffin                                       g2 at
Publisher of dspGuru                 
Iowegian International Corporation  

More information about the Python-list mailing list