title: For list unless empty in python
body: <p>I've been writing a lot of constructs like this the past couple of days:</p>
  
  <pre><code>list = get_list()
  if list:
      for i in list:
          pass # do something with the list
  else:
      pass # do something if the list was empty
  </code></pre>
  
  <p>Lot of junk and I assign the list to a real variable (keeping it in memory longer than needed). Python has simplified a lot of my code up til now... Is there a easy way to do this?</p>
  
  <p>(My understanding is that the <code>else</code> in the <code>for: else:</code> construct always triggers after it has looped, empty or not - so not what I want)</p>