title: Test if a variable is a list or tuple
body: <p>In python, what's the best way to test if a variable contains a list or a tuple? (ie. a collection)</p>
  
  <p>Is <code>isinstance()</code> as evil as suggested here? <a href="http://www.canonical.org/~kragen/isinstance/" rel="noreferrer">http://www.canonical.org/~kragen/isinstance/</a></p>
  
  <p>Update: the most common reason I want to distinguish a list from a string is when I have some indefinitely deep nested tree / data-structure of lists of lists of lists of strings etc. which I'm exploring with a recursive algorithm and I need to know when I've hit the "leaf" nodes.</p>