title: TypeVar in class __init__ type hinting
body: <p>I am trying to use a TypeVar to indicate an init parameter as a certain type.
  But I am doing it wrong, or it might not even be possible.</p>
  <pre><code>from typing import TypeVar
  
  T=TypeVar(&quot;T&quot;)
  
  class TestClass:
      def __init__(self,value:T):
          self._value=value
  
  a = TestClass(value=10)
  b = TestClass(value=&quot;abc&quot;)
  
  reveal_type(a._value)
  reveal_type(b._value)
  </code></pre>
  <p>I was hoping the reveal type of <code>a._value</code> would have been <code>int</code> and <code>b._value</code> to have been <code>string</code>.
  But they are both revealed as 'T`-1'</p>
  <p>Any help or insight appreciated!</p>
  <p>[EDIT]</p>
  <p>A little more expanded example.
  The BaseClass will be overridden and the actual type hint is provided by the overriding class.</p>
  <pre><code>from typing import TypeVar
  
  T=TypeVar(&quot;T&quot;)
  
  class BaseClass:
      def __init__(self,value):
          self._value = value
  
  class Class1(BaseClass):
      def __init__(self,value:str):
          super().__init__(value)
  
  class Class2(BaseClass):
      def __init__(self,value:int):
          super().__init__(value)
  
  a = Class1(&quot;A value&quot;)
  b = Class2(10)
  
  reveal_type(a._value)
  reveal_type(b._value)
  </code></pre>