very good reasons?

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


In article <wkaecrf2ef.fsf at turangalila.harmonixmusic.com>, Dan says...
>
>Grant Griffin <g2 at seebelow.org> 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,

=g2
*see http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=651573602&fmt=text

_____________________________________________________________________

Grant R. Griffin                                       g2 at dspguru.com
Publisher of dspGuru                           http://www.dspguru.com
Iowegian International Corporation            http://www.iowegian.com




More information about the Python-list mailing list