basic language question

Michael Peuser mpeuser at web.de
Thu Sep 4 14:58:04 EDT 2003


"Stephan Diehl" <stephan.diehl at gmx.net> schrieb im Newsbeitrag
news:bj7ots$48j$06$1 at news.t-online.com...
> 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.

There is a very old religious law saying: Thou shalt not cause side effects
by a function.
There is some wisdom in it but it is easily forgotten with languages which
do not differ between functions and routines.

Kindly
Michael P






More information about the Python-list mailing list