def makeId(cls, m):
        """ Make identity matrix of rank (mxm) """

        rows = [[0]*m for x in range(m)]
        idx = 0
        
        for row in rows:
            row[idx] = 1
            idx += 1

        return cls.fromList(rows)
 Make identity matrix of rank (mxm) 
recipes/Python/578131_A_simple_Matrix_class/recipe-578131.py