title: How to check if a variable contains a type or a list of types?
body: <p>I'd like to pass a type or a list of types as an argument to a function. But within the function I need to distinguish between the type and the list of types. Roughly explained I need some kind of branching like this:</p>
  
  <pre><code>if //someVar is a type//:
      ....
  elif isinstance(someVar, list):
      for t in list:
          if //t is a type//:
              ....
          else:
              print("ERROR")
  else
      print("ERROR")
  </code></pre>
  
  <p>Types can either be some "primitive" like <em>int</em> or <em>str</em> but also tuples or classes as well.</p>
  
  <p>The question: How can I correctly and efficiently distinguish between types and list of types?</p>