title: Assertions and testing emptiness of iterables
body: <p><strong>Using the built-in <code>assert</code> statement</strong>, is there a good, Pythonic way of checking emptiness in an iterable? I have seen:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3114252/one-liner-to-check-whether-an-iterator-yields-at-least-one-element">One-liner to check whether an iterator yields at least one element?</a>;</li>
  <li><a href="https://stackoverflow.com/questions/33216488/is-there-any-way-to-check-with-python-unittest-assert-if-an-iterable-is-not-empt">Is there any way to check with Python unittest assert if an iterable is not empty?</a>; and </li>
  <li><a href="https://stackoverflow.com/questions/53513/best-way-to-check-if-a-list-is-empty">Best way to check if a list is empty</a>;</li>
  </ul>
  
  <p>but I'm looking for a solution using assertions. The following <em>looks</em> to work, but I am unsure whether I'm missing some important possible exception:</p>
  
  <pre><code>a = [1, 2, 3]
  b = []
  
  assert a, 'a is empty'
  assert b, 'b is empty'
  </code></pre>
  
  <p>Which raises this <code>AssertionError</code>:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;ipython-input-9-185714f6eb3c&gt;", line 5, in &lt;module&gt;
      assert b, 'b is empty'
  AssertionError: b is empty
  </code></pre>