L
Lie
I expect functions with no documentation of what they return to return
`None`. Assuming they are documented at all, of course.
It's like not writing a ``return`` statement in the code: there's always an
implicit ``return None`` at the end of every function.
I personally won't to rely on it. Sometimes a return statement might
be documented, but not complete enough, like this:
def genericadd(a, b):
"""
Adds two number, returns the same as longadd if
either operands are long type and returns the same
as intadd if all operands are int type.
<ommiting documentation about what would happen if
either type are neither long nor int by negligence>
"""
if isinstance(a, long) or isinstance(b, long):
return longadd(a, b)
if isinstance(a, int) and isinstance(b, int):
return intadd(a, b)
return "Error"
This function is written badly on purpose to simulate what a less-than-
intelligent programmer might write, which is in no control of ours as
a class user.