lundi 29 décembre 2014

Proper Python Syntax and Semantics: if, else, pass [duplicate]


This question already has an answer here:




Is there a preferred/proper style?



This:



def fx(Boolean):
if Boolean:
# Do stuff.
else:
pass


Or this:



def fx(Boolean):
if Boolean:
# Do stuff.


Is it preferred/proper to include else: pass if you don't want anything to happen?

I've read PEP 8 - Style Guide for Python Code and did not find anything concerning my question.


Aucun commentaire:

Enregistrer un commentaire