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

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -