very good reasons?

Dan Schmidt dfan at
Fri Sep 29 21:01:44 CEST 2000

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.

                 Dan Schmidt |
Honest Bob CD now available! |

More information about the Python-list mailing list