Why return None?
martindemello at yahoo.com
Wed Aug 25 12:27:51 CEST 2004
Anthony Baxter <anthonybaxter at gmail.com> wrote:
> On Wed, 25 Aug 2004 08:26:26 GMT, Martin DeMello
> <martindemello at yahoo.com> wrote:
> > It seems to be a fairly common pattern for an object-modifying method to
> > return None - however, this is often quite inconvenient.
> list.reverse() modifies the list in place. The python idiom is that
> these don't return a reference to the modified list. Although note the
Yes, but why? I mean, is there either an advantage to returning None or
some inherent danger in returning self?
More information about the Python-list