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

Fix AttributeError in PowerSeriesRing for division #39713

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
24 changes: 21 additions & 3 deletions src/sage/rings/power_series_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
from sage.structure.parent import Parent
from sage.structure.nonexact import Nonexact
from sage.structure.unique_representation import UniqueRepresentation
from sage.rings.laurent_series_ring import LaurentSeriesRing

_CommutativeRings = commutative_rings.CommutativeRings()
import sage.categories.integral_domains as integral_domains
Expand All @@ -171,8 +172,8 @@
from .laurent_series_ring import LaurentSeriesRing
from .laurent_series_ring_element import LaurentSeries
except ImportError:
LaurentSeriesRing = ()
LaurentSeries = ()
from sage.rings.laurent_series_ring import LaurentSeriesRing
from sage.rings.laurent_series_ring_element import LaurentSeries

lazy_import('sage.rings.lazy_series_ring', 'LazyPowerSeriesRing')

Expand Down Expand Up @@ -602,6 +603,24 @@ def __init__(self, base_ring, name=None, default_prec=None, sparse=False,
else:
self.__generator = self.element_class(self, R.gen(), is_gen=True)

def _pseudo_fraction_field(self):
"""
Return the pseudo-fraction field of this power series ring.

This is the Laurent series ring over the same base ring with the same
variable name, where division is defined.

EXAMPLES::
sage: R.<x> = PowerSeriesRing(QQ)
sage: R._pseudo_fraction_field()
Laurent Series Ring in x over Rational Field
sage: K.<z> = PowerSeriesRing(QQ)
sage: R.<x> = PowerSeriesRing(K)
sage: R._pseudo_fraction_field()
Laurent Series Ring in x over Power Series Ring in z over Rational Field
"""
return LaurentSeriesRing(self.base_ring(), self._names[0])

def variable_names_recursive(self, depth=None):
r"""
Return the list of variable names of this and its base rings.
Expand Down Expand Up @@ -1422,7 +1441,6 @@ def fraction_field(self):
"""
return self.laurent_series_ring()


def unpickle_power_series_ring_v0(base_ring, name, default_prec, sparse):
"""
Unpickle (deserialize) a univariate power series ring according to
Expand Down