sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.45k stars 481 forks source link

MPolynomialRing_polydict not well tested #24263

Open embray opened 6 years ago

embray commented 6 years ago

Something I hit upon in fixing some Python 3 issues is the sage.rings.polynomial.multi_polynomial_ring module and the MPolynomialRing_polydict class and its associated elements.

This is an example of where Sage's policy of "every function must have tests" does not actually guarantee good coverage, as few (if any) of the tests for this class explicitly use it. Instead many of the tests use the generic PolynomialRing constructor, which for many cases ends up returning Singular polynomial rings instead, so the relevant implementation does not end up being well tested (except perhaps indirectly in the cases of parent rings that are not handled by Singular).

It would be better if these tests used the class being tested explicitly, or perhaps if PolynomialRing had a better way to explicitly force the implementation to use (the existing implementation= keyword doesn't really do much currently except force Singular).

Component: algebra

Issue created by migration from https://trac.sagemath.org/ticket/24263

jdemeyer commented 6 years ago

Replying to @embray:

perhaps if PolynomialRing had a better way to explicitly force the implementation to use (the existing implementation= keyword doesn't really do much currently except force Singular).

That should be easy: #24264.