Ticket #8713: trac_8713-an_element-nt.patch

File trac_8713-an_element-nt.patch, 1.9 KB (added by nthiery, 3 years ago)
  • sage/structure/parent.pxd

    # HG changeset patch
    # User Nicolas M. Thiery <nthiery@users.sf.net>
    # Date 1271627092 -7200
    # Node ID fe8fb8e3c14ebe7934d129d7da8b7308945fc524
    # Parent  6ca6a296429ee2c8c01f881de053ef7f888bd79b
    #8713: Prepare the ground for moving Parent._an_element_ to Sets().ParentMethods
    
    diff --git a/sage/structure/parent.pxd b/sage/structure/parent.pxd
    a b cdef class Parent(category_object.Catego 
    5151    cpdef coerce(self, x) 
    5252 
    5353    cpdef an_element(self) 
    54     cpdef _an_element_(self) 
    5554    cdef public object __an_element 
    5655 
    5756 
  • sage/structure/parent.pyx

    diff --git a/sage/structure/parent.pyx b/sage/structure/parent.pyx
    a b cdef class Parent(category_object.Catego 
    20702070            self.__an_element = self._an_element_() 
    20712071        return self.__an_element 
    20722072         
    2073     cpdef _an_element_(self): 
     2073    def _an_element_(self): 
    20742074        """ 
    20752075        Returns an element of self. Want it in sufficient generality 
    20762076        that poorly-written functions won't work when they're not 
  • sage/structure/parent_old.pyx

    diff --git a/sage/structure/parent_old.pyx b/sage/structure/parent_old.pyx
    a b cdef class Parent(parent.Parent): 
    505505        else: 
    506506            return parent.Parent._get_action_(self, other, op, self_on_left) 
    507507     
    508     cpdef _an_element_(self): 
     508    def _an_element_(self): 
    509509        if self._element_constructor is None: 
    510510            return self._an_element_c() 
    511511        else: 
  • sage/symbolic/ring.pyx

    diff --git a/sage/symbolic/ring.pyx b/sage/symbolic/ring.pyx
    a b cdef class SymbolicRing(CommutativeRing) 
    364364        """ 
    365365        return Integer(0) 
    366366 
    367     cpdef _an_element_(self): 
     367    def _an_element_(self): 
    368368        """ 
    369369        Return an element of the symbolic ring, which is used by the 
    370370        coercion model.