title: Dynamic TypeVar for a sequence of types
body: <p>why is it not possible to declare a <code>TypeVar</code> as a list (sequence) of multiple types? Imagine a generic signal-emitting class that can take variable number of differently typed parameters:</p>
  <pre class="lang-py prettyprint-override"><code>from typing import Any, Callable, Generic, TypeVar
  
  T = TypeVar(&quot;T&quot;)
  
  class Signal(Generic[T]):
      def add_callback(self, func: Callable[[T], Any]):
          ...
  
      def emit(self, arg: T):
          ...
  
  def callback(a: int):
      ...
  
  def callback_bad(a: str):
      ...
  
  
  # Fun part, works as intended
  sig: Signal[int] = Signal()
  
  sig.add_callback(callback)  # Good lint
  sig.emit(1223)
  
  sig.add_callback(callback_bad)  # Bad lint
  sig.emit(&quot;I am a werewolf&quot;)
  
  </code></pre>
  <p>Now what I want to archive is a signal that emits different types, here <code>int, str</code>. I did not find anything on the desired behaviour (other then hard coding) in the Python docs. IMO, it should be possible to archive this dynamic typing behavior! There are different use cases I can imagine.</p>
  <pre class="lang-py prettyprint-override"><code># TypeVar as a list of multiple types fails
  sig: Signal[int, str] = Signal()
  </code></pre>
  <p>Sure, one can use a <code>Tuple[]</code> but the <code>TypeVar</code> cannot be unpacked into the <code>*args</code>.</p>