title: Python Generic class of Matrix, I receive Cannot instantiate typing.TypeVar error
body: <p>I have written the following code. But I am receiving <code>TypeError: Cannot instantiate typing.TypeVar</code></p>
  <pre><code>from typing import TypeVar, Generic, List, Tuple
  T = TypeVar('T')
  
  
  class MyInt:
      p: int
  
      def __init__(self, value: int):
          self.p = value
  
  
  class Vector(Generic[T]):
      items: List[T]
  
      def __init__(self, sz: int):
          self.items = [T(0) for _ in range(sz)]
  
      def __init__(self, l: List[T]):
          self.items = l
  
  
  class Matrix(Generic[T]):
      items: List[Vector[T]]
  
      def __init__(self, rw: int, cl: int):
          self.items = [Vector[T](cl) for _ in range(rw)]
  
      def __init__(self, sz: Tuple[int, int]):
          rw, cl = sz
          self.items = [Vector[T](cl) for _ in range(rw)]
  
  
  myMatrix = Matrix[MyInt](1, 2)
  </code></pre>
  <p>I don't know how to create an instance of <code>MyInt</code> when I create an instance of <code>Matrix[MyInt]</code>. Can you help me in this?</p>