basic language question

Daniel Dittmar daniel.dittmar at sap.com
Thu Sep 4 18:33:01 CEST 2003


Stephan Diehl wrote:
> Once in a while, I get bitten by the fact, that mutating list methods
> such as 'append' or 'extend' return None instead of the (mutated)
> list itself. Is there a compelling reason for that? I googled around,
> but didn't find anything about this.
> Thanks
>
> Stephan

The reasons described for sort ()
<http://www.python.org/doc/faq/general.html#why-doesn-t-list-sort-return-the
-sorted-list> also apply to append and extend.

Daniel







More information about the Python-list mailing list