Skip to content

Commit c584ca0

Browse files
author
Matthias Koeppe
committed
PolynomialRing_integral_domain.construction: Add doctest and implementation note
1 parent 94f0451 commit c584ca0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/sage/rings/polynomial/polynomial_ring.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,8 +1957,29 @@ def _repr_(self):
19571957
def construction(self):
19581958
"""
19591959
Return the construction functor.
1960+
1961+
EXAMPLES::
1962+
1963+
sage: from sage.rings.polynomial.polynomial_ring import PolynomialRing_integral_domain as PRing
1964+
sage: R = PRing(ZZ, 'x'); R
1965+
sage: functor, arg = R.construction(); functor, arg
1966+
(Poly[x], Integer Ring)
1967+
sage: functor.implementation is None
1968+
True
1969+
1970+
sage: R = PRing(ZZ, 'x', implementation='NTL'); R
1971+
sage: functor, arg = R.construction(); functor, arg
1972+
(Poly[x], Integer Ring)
1973+
sage: functor.implementation
1974+
'NTL'
19601975
"""
19611976
implementation = None
1977+
# NOTE: This is obviously not a complete solution. The parents
1978+
# don't keep track in a clean way what the implementation is.
1979+
# Trac #31852 is the task of finding a general solution for
1980+
# construction functors of parents with multiple
1981+
# implementations, such as MatrixSpace, Polyhedron, and
1982+
# PolynomialRing.
19621983
if 'NTL' in self._implementation_repr:
19631984
implementation = 'NTL'
19641985
return categories.pushout.PolynomialFunctor(self.variable_name(), sparse=self.is_sparse(),

0 commit comments

Comments
 (0)