I want to create an instance of the class within myself. I tried to do it as follows:
class matrix: (...) def det(self): (...) m = self(sz-1, sz-1) (...) (...)
but I got an error:
m = self(sz-1, sz-1)
AttributeError: the matrix instance has no __call__ method
So, I tried to do it as follows:
class matrix: (...) def det(self): (...) m = matrix(sz-1, sz-1) (...) (...)
and I got another error:
m = matrix(sz-1, sz-1)
NameError: global name 'matrix' not defined
Of course, a matrix is not a global class. I do not know how to solve this problem.
python class instance
pablo
source share