python - Is it more pythonic to close a function with return or through indentation? -


if have function not need return variable, considered better coding practice close function this:

def foo():     """code"""     return # more code 

or this?

def bar():    """code""" # more code 

i'd use bare return exit function. @ end of function leaves me wondering if meant return , forgot finish.


Comments

Popular posts from this blog

All overlapping substrings matching a java regex -

c++ - Using OpenSSL in a multi-threaded application -

php - Deleting/Renaming a locked file -