Ticket #6669: trac-6669-matrix_hom.patch

File trac-6669-matrix_hom.patch, 991 bytes (added by mraum, 12 years ago)
  • sage/groups/matrix_gps/matrix_group.py

    diff -r 5bf36a37cd0c sage/groups/matrix_gps/matrix_group.py
    a b  
    228228    def _Hom_(self, G, cat=None):
    229229        if not (cat is None or (cat is G.category() and cat is self.category())):
    230230            raise NotImplementedError
    231         if not is_MatrixGroup(G):
    232             raise TypeError, "G (=%s) must be a matrix group."%G
    233         import homset
    234         return homset.MatrixGroupHomset(self, G)
     231       
     232        if is_MatrixGroup(G):
     233            import homset
     234            return homset.MatrixGroupHomset(self, G)
     235        else :
     236            from sage.categories.homset import Homset
     237            from sage.categories.category_types import Groups
     238
     239            return Homset(self, G, Groups(), False)
     240
     241        #raise TypeError, "G (=%s) must be a matrix group."%G
    235242
    236243    def hom(self, x):
    237244        v = Sequence(x)