# 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 |
| 51 | 51 | cpdef coerce(self, x) |
| 52 | 52 | |
| 53 | 53 | cpdef an_element(self) |
| 54 | | cpdef _an_element_(self) |
| 55 | 54 | cdef public object __an_element |
| 56 | 55 | |
| 57 | 56 | |
diff --git a/sage/structure/parent.pyx b/sage/structure/parent.pyx
|
a
|
b
|
cdef class Parent(category_object.Catego |
| 2070 | 2070 | self.__an_element = self._an_element_() |
| 2071 | 2071 | return self.__an_element |
| 2072 | 2072 | |
| 2073 | | cpdef _an_element_(self): |
| | 2073 | def _an_element_(self): |
| 2074 | 2074 | """ |
| 2075 | 2075 | Returns an element of self. Want it in sufficient generality |
| 2076 | 2076 | that poorly-written functions won't work when they're not |
diff --git a/sage/structure/parent_old.pyx b/sage/structure/parent_old.pyx
|
a
|
b
|
cdef class Parent(parent.Parent): |
| 505 | 505 | else: |
| 506 | 506 | return parent.Parent._get_action_(self, other, op, self_on_left) |
| 507 | 507 | |
| 508 | | cpdef _an_element_(self): |
| | 508 | def _an_element_(self): |
| 509 | 509 | if self._element_constructor is None: |
| 510 | 510 | return self._an_element_c() |
| 511 | 511 | else: |
diff --git a/sage/symbolic/ring.pyx b/sage/symbolic/ring.pyx
|
a
|
b
|
cdef class SymbolicRing(CommutativeRing) |
| 364 | 364 | """ |
| 365 | 365 | return Integer(0) |
| 366 | 366 | |
| 367 | | cpdef _an_element_(self): |
| | 367 | def _an_element_(self): |
| 368 | 368 | """ |
| 369 | 369 | Return an element of the symbolic ring, which is used by the |
| 370 | 370 | coercion model. |