Skip to content

Commit

Permalink
use Parent in Symbolic Ring
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Mar 6, 2024
1 parent cb8e15b commit 6196143
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/sage/symbolic/ring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ The symbolic ring
# ****************************************************************************

from sage.rings.integer cimport Integer
from sage.rings.ring cimport CommutativeRing

import sage.rings.abc

Expand All @@ -45,7 +44,9 @@ from sage.symbolic.expression cimport (
new_Expression_symbol,
)

from sage.categories.commutative_rings import CommutativeRings
from sage.structure.element cimport Element, Expression
from sage.structure.parent cimport Parent
from sage.categories.morphism cimport Morphism
from sage.structure.coerce cimport is_numpy_type

Expand All @@ -71,6 +72,8 @@ cdef class SymbolicRing(sage.rings.abc.SymbolicRing):
"""
Initialize the Symbolic Ring.
This is a commutative ring of symbolic expressions and functions.
EXAMPLES::
sage: SR
Expand All @@ -85,7 +88,7 @@ cdef class SymbolicRing(sage.rings.abc.SymbolicRing):
"""
if base_ring is None:
base_ring = self
CommutativeRing.__init__(self, base_ring)
Parent.__init__(self, base_ring, category=CommutativeRings())
self._populate_coercion_lists_(convert_method_name='_symbolic_')
self.symbols = {}

Expand All @@ -98,9 +101,9 @@ cdef class SymbolicRing(sage.rings.abc.SymbolicRing):
"""
return the_SymbolicRing, tuple()

def _repr_(self):
def _repr_(self) -> str:
"""
Return a string representation of self.
Return a string representation of ``self``.

EXAMPLES::

Expand Down

0 comments on commit 6196143

Please sign in to comment.