Q about tail recursion

François Pinard pinard at iro.umontreal.ca
Sun Feb 27 01:06:59 EST 2000


Harald Hanche-Olsen <hanche at math.ntnu.no> writes:

> Um, not really, because they are followed by an implicit "return None".

By the way, I sometimes hesitate at having an explicit:

        return None

as the last line of a function.  I guess I usually give in writing it, would
it be only as some kind of documentation, but then (being anal myself :-)
I would consider as a style bug not doing it always, if I do it sometimes.
(It would of course always be OK _not_ writing that line for `def's not
meant to return a usable value.)

I wonder a bit.  Is there any common wisdom about this detail?

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list