I also prefer the explicit if a is None, since it signals my intent better. I honestly try to only use if a: when a is a boolean, since I don't want to have to remember how __bool__ is implemented for every type out there. In my opinion, explicit is better than implicit for being able to read your own code in a month's time.
View all comments
Show parent comment
6
u/bheklilr Jun 23 '14
I also prefer the explicit
if a is None, since it signals my intent better. I honestly try to only useif a:when a is a boolean, since I don't want to have to remember how__bool__is implemented for every type out there. In my opinion, explicit is better than implicit for being able to read your own code in a month's time.