4 ms·
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
by jessaustin 13y ago
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.
- StavrosK 13y agoIn [1]: def foo(): pass In [2]: foo() is None Out[2]: True
- jessaustin 13y agoI was speculating about what the original complainer meant, not about what python does... b^)
- pyre 13y agoYes, 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`.