Hacker News new | past | comments | ask | show | jobs | submit login

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.



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


I was speculating about what the original complainer meant, not about what python does... b^)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: