title: Type Error takes 1 positional argument but 4 were given
body: <p>I am currently working on this code for my homework assignment involving Matrix Implementation:</p>
  
  <pre><code>class MyMatrix(object):
      def __init__(self, n, m, t):
          self.n = n
          self.m = m
          self.t = t
  
          self.data = []
          for i in range(0, self.n):
              row = []
              for i in range (0, self.m):
                  row.append(self.t())
              self.data.append(row)
  
      def set(self, i, j, v):
          self.data[i][j] = v
  
      def get(self, i, j):
          self.data[i][j]
  
      def __str__(self):
          n = self.__class__.__name__ + "({})".format((self.n,self.m))
          for i in range(0, self.n):
              for j in range(0, self.m):
                  s += str(self.get(i,j)) + " "
              s += "\n"
          return s
  
  class MySparseMatrix(MyMatrix):
  
      def __init__(self):
          def __init__(self, n, m, t):
              self.n = n
              self.m = m
              self.t = t
              self.data = {}
  
      def set(self, i, j, v):
          key = (i, j)
          self.data[key] = v
  
      def get(self, i,j):
          key = (i, j)
          return self.data.get(key, self.t())
  </code></pre>
  
  <p>I am trying to print: </p>
  
  <pre><code>tt = MySparseMatrix(int, 2, 2)
  tt.set(0,0,11)
  tt.set(0,1,5)
  tt.set(1,0,2)
  print(tt.get(0,1))
  print("tt = ", tt)
  </code></pre>
  
  <p>But it gives me </p>
  
  <pre><code>TypeError: __init__() takes 1 positional argument but 4 were given
  </code></pre>
  
  <p>Any suggestions on how to fix this error? I am very new to Python.</p>
  
  <p>(Said I needed to add more detail to my question so ignore this: dfjsdfasjdfasdjfasfajfkajsfkajsdfksakfjasdfkjasdfkasdfnasdfbafdbhsdfdfdfskfjdfjsfjsfsjafasjdfaskfgskadfakfaskdfaskfdalsfkasfdkalsdfkasldfksldfkasdfkasdflksdflaksfdlkasdflaksdfkafa)</p>