Google Python Style Guide
<p><pre><code>  2.14 True/False Evaluations
  Use the “implicit” false if at all possible.

</code></pre>
This one is my personal bug-bear. I find this:<p><pre><code>  if not users:
     ...
</code></pre>
significantly worse than:<p><pre><code>  if users == []:
      ...
</code></pre>
The second is totally explicit, reminds the reader that users is (expected to be) a list and makes it totally clear that we can only enter the conditional block if users is an empty list.<p>The first option:<p>a) obfuscates the type of users on first reading<p>b) evaluates to True if users is None (or LOADS of other things?!) which can lead to hard-to-find bugs.<p>Granted, type-checking can help here but purely from a readability perspective the second option seems way more friendly and for almost no downside. The same holds true for all of the "False-y" objects:<p><pre><code>  if users == {}:
  if users == 0:
  if users is None:
  if users == ():
  if users is False:</code></pre>
Why is the implicit:<p><pre><code>  if not users:</code></pre>
an improvement in any of these cases?<p><pre><code>  If you need to distinguish False from None then chain the expressions, such as if not x and x is not None:.
</code></pre>
!!!<p>Why not just:<p><pre><code>  if x is False:

?</code></pre>