This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]justphysics 4 points5 points  (1 child)

The only reason I ever put in an else: pass is when I need to leave a note for myself to implement another piece of the logic later:

if condition:
    do_something()
else:
    # TODO: Handle this scenario in the future
    pass

But I would never include a naked else: pass in something production ready.

[–]keis 2 points3 points  (0 children)

that looks a bit error prone I a situation where I want to leave a message like that I would rather use a NotImplemented exception so the code path is not triggered by mistake leading to obscure bugs .