Why return None?

Peter Hansen peter at engcorp.com
Thu Aug 26 01:36:10 EDT 2004


Martin DeMello wrote:

> It seems to be a fairly common pattern for an object-modifying method to
> return None - however, this is often quite inconvenient.

http://www.python.org/doc/faq/general.html#why-doesn-t-list-sort-return-the-sorted-list

(Not an answer to the general question you ask, unless you
extrapolate from the specific answer given there to the
more general case.)

-Peter



More information about the Python-list mailing list