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

Commit

Permalink
Trac #31722: turn is_field and is_integral_domain into cpdef function…
Browse files Browse the repository at this point in the history
…s (completely doctested)
  • Loading branch information
mjungmath committed Apr 25, 2021
1 parent de32db6 commit 078162b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/sage/rings/polynomial/multi_polynomial_ring_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ cdef class MPolynomialRing_base(sage.rings.ring.CommutativeRing):
category = polynomial_default_category(base_ring.category(), n)
sage.rings.ring.Ring.__init__(self, base_ring, names, category=category)

def is_integral_domain(self, proof = True):
cpdef bint is_integral_domain(self, proof=True) except -2:
"""
EXAMPLES::
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/ring.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ cdef class Ring(ParentWithGens):
cdef public object _zero_ideal
cdef public object _unit_ideal
cdef public object __ideal_monoid
cpdef bint is_field(self, proof=*) except -2
cpdef bint is_integral_domain(self, proof=*) except -2


cdef class CommutativeRing(Ring):
Expand Down
6 changes: 3 additions & 3 deletions src/sage/rings/ring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ cdef class Ring(ParentWithGens):
return True
raise NotImplementedError

def is_field(self, proof = True):
cpdef bint is_field(self, proof=True) except -2:
"""
Return ``True`` if this ring is a field.
Expand Down Expand Up @@ -920,7 +920,7 @@ cdef class Ring(ParentWithGens):
"""
return False

def is_integral_domain(self, proof = True):
cpdef bint is_integral_domain(self, proof=True) except -2:
"""
Return ``True`` if this ring is an integral domain.
Expand Down Expand Up @@ -1782,7 +1782,7 @@ cdef class IntegralDomain(CommutativeRing):
CommutativeRing.__init__(self, base_ring, names=names, normalize=normalize,
category=category)

def is_integral_domain(self, proof = True):
cpdef bint is_integral_domain(self, proof=True) except -2:
"""
Return ``True``, since this ring is an integral domain.
Expand Down
1 change: 0 additions & 1 deletion src/sage/structure/element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4146,7 +4146,6 @@ cdef class FieldElement(CommutativeRingElement):
sage: R.<x,y> = QQ[]
sage: S.<a,b> = R.quo(y^2 + 1)
sage: S.is_field = lambda : False
sage: F = Frac(S); u = F.one()
sage: u.quo_rem(u)
(1, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/symbolic/ring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ cdef class SymbolicRing(CommutativeRing):
"""
return self.symbol('some_variable')

def is_field(self, proof = True):
cpdef bint is_field(self, proof=True) except -2:
"""
Returns True, since the symbolic expression ring is (for the most
part) a field.
Expand Down

0 comments on commit 078162b

Please sign in to comment.