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

Commit

Permalink
Fix 26958
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvatore Stella committed Dec 25, 2018
1 parent 934b744 commit d628f14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/sage/rings/polynomial/multi_polynomial_ring_base.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cimport sage.rings.ring
from sage.structure.parent cimport Parent
from cpython cimport bool

cdef class MPolynomialRing_base(sage.rings.ring.CommutativeRing):
cdef public bool _no_generic_basering_coercion
cdef object __ngens
cdef object __term_order
cdef public object _has_singular
Expand Down
11 changes: 11 additions & 0 deletions src/sage/rings/polynomial/multi_polynomial_ring_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ cdef class MPolynomialRing_base(sage.rings.ring.CommutativeRing):
True
sage: A1(a) in A2
True
Check that :trac:`26958` is fixed::
sage: from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular
sage: class Foo(MPolynomialRing_libsingular):
....: pass
sage: Foo(QQ, 2, ['x','y'], 'degrevlex')
Multivariate Polynomial Ring in x, y over Rational Field
"""
if base_ring not in _CommutativeRings:
raise TypeError("The base ring %s is not a commutative ring" % base_ring)
Expand All @@ -85,6 +93,9 @@ cdef class MPolynomialRing_base(sage.rings.ring.CommutativeRing):
else:
category = polynomial_default_category(base_ring.category(), n)

# Avoid calling __init_extra__ of Algebras(...).parent_class
self._no_generic_basering_coercion = True

sage.rings.ring.Ring.__init__(self, base_ring, names, category=category)

def is_integral_domain(self, proof = True):
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 @@ -11496,7 +11496,7 @@ cdef class PolynomialBaseringInjection(Morphism):
By :trac:`9944`, there are now only very few exceptions::
sage: PolynomialRing(QQ,names=[]).coerce_map_from(QQ)
Generic morphism:
Call morphism:
From: Rational Field
To: Multivariate Polynomial Ring in no variables over Rational Field
"""
Expand Down

0 comments on commit d628f14

Please sign in to comment.