Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
trac 21887 undo aliasing in pxi files too
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton committed Nov 17, 2016
1 parent 41d63ab commit 28728df
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/sage/rings/padics/CA_template.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ cdef class CAElement(pAdicTemplateElement):
return True
return mpz_cmp_si((<Integer>absprec).value, val) <= 0

def __bool__(self):
def __nonzero__(self):
"""
Whether this element should be considered true in a boolean context.
Expand All @@ -621,8 +621,6 @@ cdef class CAElement(pAdicTemplateElement):
"""
return not ciszero(self.value, self.prime_pow)

__nonzero__ = __bool__

def is_equal_to(self, _right, absprec=None):
r"""
Determines whether the inputs are equal modulo
Expand Down
4 changes: 1 addition & 3 deletions src/sage/rings/padics/CR_template.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ cdef class CRElement(pAdicTemplateElement):
return True
return mpz_cmp_si((<Integer>absprec).value, self.ordp) <= 0

def __bool__(self):
def __nonzero__(self):
"""
Returns True if self is distinguishable from zero.
Expand All @@ -975,8 +975,6 @@ cdef class CRElement(pAdicTemplateElement):
"""
return self.relprec != 0

__nonzero__ = __bool__

def is_equal_to(self, _right, absprec=None):
r"""
Returns whether self is equal to right modulo
Expand Down
4 changes: 1 addition & 3 deletions src/sage/rings/padics/FM_template.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ cdef class FMElement(pAdicTemplateElement):
cdef long val = self.valuation_c()
return mpz_cmp_si((<Integer>absprec).value, val) <= 0

def __bool__(self):
def __nonzero__(self):
"""
Returns True if this element is distinguishable from zero.
Expand All @@ -497,8 +497,6 @@ cdef class FMElement(pAdicTemplateElement):
"""
return not ciszero(self.value, self.prime_pow)

__nonzero__ = __bool__

def is_equal_to(self, _right, absprec=None):
r"""
Returns whether this element is equal to ``right`` modulo `p^{\mbox{absprec}}`.
Expand Down
4 changes: 1 addition & 3 deletions src/sage/rings/polynomial/polynomial_template.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ cdef class Polynomial_template(Polynomial):
raise ValueError("Cannot coerce polynomial with degree %d to integer."%(self.degree()))
return int(self[0])

def __bool__(self):
def __nonzero__(self):
"""
EXAMPLE::
Expand All @@ -529,8 +529,6 @@ cdef class Polynomial_template(Polynomial):
"""
return not celement_is_zero(&self.x, (<Polynomial_template>self)._cparent)

__nonzero__ = __bool__

cpdef int _cmp_(left, right) except -2:
"""
EXAMPLE::
Expand Down

0 comments on commit 28728df

Please sign in to comment.