Changeset 8421:a814bd4af102


Ignore:
Timestamp:
11/11/07 13:53:35 (6 years ago)
Author:
David Roe <roed@…>
Branch:
default
Message:

Small changes to sage.rings.morphism

Location:
sage/rings
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sage/rings/morphism.pxd

    r6772 r8421  
     1 
    12from sage.structure.element cimport Element 
    23from sage.categories.morphism cimport Morphism 
     
    1718    cdef _extra_slots(self, _slots) 
    1819 
    19 cdef class RingHomomorphism_coerce(RingHomomorphism): 
     20cdef class RingHomomorphism_coercion(RingHomomorphism): 
    2021    cdef Element _call_c_impl(self, Element x) 
    2122 
  • sage/rings/morphism.pyx

    r7081 r8421  
    508508 
    509509cdef class RingHomomorphism_coercion(RingHomomorphism): 
    510     def __init__(self, parent): 
     510    def __init__(self, parent, check = True): 
    511511        RingHomomorphism.__init__(self, parent) 
    512         if not self.codomain().has_coerce_map_from(self.domain()): 
     512        # putting in check allows us to define subclasses of RingHomomorphism_coercion that implement _coerce_map_from 
     513        if check and not self.codomain().has_coerce_map_from(self.domain()): 
    513514            raise TypeError, "Natural coercion morphism from %s to %s not defined."%(self.domain(), self.codomain()) 
    514515 
Note: See TracChangeset for help on using the changeset viewer.