Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Parent in Symbolic Ring #37555

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading