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

Commit

Permalink
trac 21887 some forgotten cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton committed Nov 17, 2016
1 parent 28728df commit b279834
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/sage/rings/complex_interval.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ cdef class ComplexIntervalFieldElement(sage.structure.element.FieldElement):
sage: bool(CIF(RIF(-1, 1), RIF(-1, 1)))
True
"""
return self.real().__bool__() or self.imag().__bool__()
return bool(self.real()) or bool(self.imag())

cpdef _richcmp_(left, right, int op):
r"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/function_field/function_field_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ cdef class FunctionFieldElement_rational(FunctionFieldElement):
"""
return repr(self._x)

def __bool__(self):
def __nonzero__(self):
"""
EXAMPLES::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/polynomial/polynomial_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8976,7 +8976,7 @@ cdef class Polynomial_generic_dense(Polynomial):
"""
return make_generic_polynomial, (self._parent, self.__coeffs)

def __bool__(self):
def __nonzero__(self):
return len(self.__coeffs) > 0

cdef int __normalize(self) except -1:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/polynomial/polynomial_modn_dense_ntl.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ cdef class Polynomial_dense_modn_ntl_ZZ(Polynomial_dense_mod_n):
return n
return infinity

def __bool__(self):
def __nonzero__(self):
"""
TESTS::
Expand Down

0 comments on commit b279834

Please sign in to comment.