title: Check if type is a list
body: <p>I have some types (coming from <code>inspect.signature</code> -> <code>inspect.Parameter</code>) and I'd like to check if they are lists or not. My current solution works but is very ugly, see minimal example below:</p>
  
  <pre><code>from typing import Dict, List, Type, TypeVar
  
  IntList = List[int]
  StrList = List[str]
  IntStrDict = Dict[int, str]
  
  TypeT = TypeVar('TypeT')
  
  # todo: Solve without using string representation of type
  def is_list_type(the_type: Type[TypeT]) -&gt; bool:
      return str(the_type)[:11] == 'typing.List'
  
  assert not is_list_type(IntStrDict)
  assert not is_list_type(int)
  assert not is_list_type(str)
  assert is_list_type(IntList)
  assert is_list_type(StrList)
  </code></pre>
  
  <p>What would be the correct way to check if a type is a <code>List</code>?</p>
  
  <p>(I'm using Python 3.6 and the code should survive a check with <code>mypy --strict</code>.)</p>