Changeset 8421:a814bd4af102
- Timestamp:
- 11/11/07 13:53:35 (6 years ago)
- Branch:
- default
- Location:
- sage/rings
- Files:
-
- 2 edited
-
morphism.pxd (modified) (2 diffs)
-
morphism.pyx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/rings/morphism.pxd
r6772 r8421 1 1 2 from sage.structure.element cimport Element 2 3 from sage.categories.morphism cimport Morphism … … 17 18 cdef _extra_slots(self, _slots) 18 19 19 cdef class RingHomomorphism_coerc e(RingHomomorphism):20 cdef class RingHomomorphism_coercion(RingHomomorphism): 20 21 cdef Element _call_c_impl(self, Element x) 21 22 -
sage/rings/morphism.pyx
r7081 r8421 508 508 509 509 cdef class RingHomomorphism_coercion(RingHomomorphism): 510 def __init__(self, parent ):510 def __init__(self, parent, check = True): 511 511 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()): 513 514 raise TypeError, "Natural coercion morphism from %s to %s not defined."%(self.domain(), self.codomain()) 514 515
Note: See TracChangeset
for help on using the changeset viewer.
