Re:Python Best Practice Patterns
by jessaustin on Friday February 28, 2014 @02:00PM
(#7320737)
Just speculating here, but a func that just ends without returning, effectively returns None, so that idiom may be considered redundant. IMHO, it's often worth the additional clarity to be redundant in this way.
[ Parent
| on HN ]
Yes, but the "Pythonic" way to do things is that "explicit is better than implicit," so I'm not sure what the original poster considers wrong with `return None`.
In [1]: def foo(): pass
In [2]: foo() is None
Out[2]: True
Re:Python Best Practice Patterns
by jessaustin on Friday February 28, 2014 @02:34PM
(#7320930)
I was speculating about what the original complainer meant, not about what python does... b^)