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

Commit 0f7c2c9

Browse files
committed
Merge branch '26161' into 26103
2 parents c68e16d + 12fd855 commit 0f7c2c9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/sage/rings/polynomial/polynomial_quotient_ring.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ def __init__(self, ring, polynomial, name=None, category=None):
387387
sage: S == PolynomialQuotientRing_generic(R,x^2-4,'xbar')
388388
True
389389
390+
Check that :trac:`26161` has been resolved::
391+
392+
sage: R.<x> = GF(2)[]
393+
sage: S = R.quo(x)
394+
sage: S in FiniteFields()
395+
True
396+
sage: type(S).mro()
397+
[<class 'sage.rings.polynomial.polynomial_quotient_ring.PolynomialQuotientRing_field_with_category'>,
398+
...
399+
<class 'sage.categories.finite_fields.FiniteFields.parent_class'>,
400+
...
401+
390402
"""
391403
if not isinstance(ring, PolynomialRing_commutative):
392404
raise TypeError("R must be a univariate polynomial ring.")
@@ -401,6 +413,9 @@ def __init__(self, ring, polynomial, name=None, category=None):
401413
self.__polynomial = polynomial
402414
category = CommutativeAlgebras(ring.base_ring()).Quotients().or_subcategory(category)
403415
if self.is_finite():
416+
# We refine the category for finite quotients.
417+
# Note that is_finite() is cheap so it does not seem to do a lazy
418+
# _refine_category_() in is_finite() as we do for is_field()
404419
category = category.Finite()
405420
CommutativeRing.__init__(self, ring, names=name, category=category)
406421

0 commit comments

Comments
 (0)