Pass and return
Mitya Sirenef
msirenef at lightbird.net
Fri Dec 21 00:45:05 EST 2012
On 12/21/2012 12:23 AM, iMath wrote:
> Pass and return
> Are these two functions the same ?
>
> def test():
> return
>
> def test():
> pass
From the point of style, of course, the latter is
much better because that's the idiomatic way
to define a no-op function. With a return, it
looks like you might have forgotten to add the
value to return or deleted it by mistake.
-m
--
Lark's Tongue Guide to Python: http://lightbird.net/larks/
More information about the Python-list
mailing list