def _repr_(self): r""" String representation of self. EXAMPLES:: sage: M = ModularSymbols(6) sage: t = M.Hom(M)(matrix(QQ,3,3,srange(9))); t._repr_() 'Hecke module morphism defined by the matrix\n[0 1 2]\n[3 4 5]\n[6 7 8]\nDomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...\nCodomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...' sage: t.name('spam'); t._repr_() 'Hecke module morphism spam defined by the matrix\n[0 1 2]\n[3 4 5]\n[6 7 8]\nDomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...\nCodomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...' """ name = self.__name if name != '': name += ' ' return "Hecke module morphism %sdefined by the matrix\n%s\nDomain: %s\nCodomain: %s"%(\ name, str(self.matrix()), misc.strunc(self.domain()), misc.strunc(self.codomain()))
def _repr_(self): r""" String representation of self. EXAMPLES:: sage: M = ModularSymbols(6) sage: t = M.Hom(M)(matrix(QQ,3,3,srange(9))); t._repr_() 'Hecke module morphism defined by the matrix\n[0 1 2]\n[3 4 5]\n[6 7 8]\nDomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...\nCodomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...' sage: t.name('spam'); t._repr_() 'Hecke module morphism spam defined by the matrix\n[0 1 2]\n[3 4 5]\n[6 7 8]\nDomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...\nCodomain: Modular Symbols space of dimension 3 for Gamma_0(6) of weight ...' """ name = self.__name if name != '': name += ' ' return "Hecke module morphism %sdefined by the matrix\n%r\nDomain: %s\nCodomain: %s"%( name, self.matrix(), misc.strunc(self.domain()), misc.strunc(self.codomain()))