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

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -