Ignore:
Timestamp:
07/12/07 22:06:46 (6 years ago)
Author:
Robert Bradshaw <robertwb@…>
Branch:
default
Message:

action coercion tweaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/categories/action.pyx

    r5474 r5475  
    130130    """ 
    131131    def __init__(self, Action action): 
    132         Action.__init__(action._G, action._S, action._is_left) 
    133         self._action = action 
     132        G = action._G 
     133        try: 
     134            from sage.groups.group import Group 
     135            if (PY_TYPE_CHECK(G, Group) and G.is_multiplicative()) or G.is_field(): 
     136                Action.__init__(self, G, action._S, action._is_left) 
     137                self._action = action 
     138        except AttributeError: 
     139            pass 
     140        raise TypeError, "No inverse defined for %r." % action 
    134141         
    135142    cdef Element _call_c(self, a, b): 
Note: See TracChangeset for help on using the changeset viewer.