title: Python empty list Exception
body: <p>I have this function:</p>
  
  <pre><code>def foo():
      a = []
      if not a:
          print "empty"
          return None
      else:
          print "not empty"
          return a
  </code></pre>
  
  <p>Is there any Exception that do the same? Just to remove the if condition. Something like this:</p>
  
  <pre><code>def foo(list):
      try:
          a = list
          return a
      except:
          return None
  </code></pre>