# HG changeset patch
# User Justin C. Walker
# Date 1236757105 25200
# Node ID 9c774cfe3de2c07431c0977d3f765f6cc02eae9a
# Parent 0cd93ee33ce622fefbdd46a7e001c229fd2ace47
Fix Trac #5482: require generator name at creation time, rather than
when the quotient ring is used the first time (e.g., just displaying
it). Change 'names' to 'name' since (as far as I can tell) this only
works for 1-variable polynomial rings.
diff -r 0cd93ee33ce6 -r 9c774cfe3de2 sage/rings/polynomial/polynomial_ring.py
--- a/sage/rings/polynomial/polynomial_ring.py Tue Mar 10 23:57:18 2009 -0700
+++ b/sage/rings/polynomial/polynomial_ring.py Wed Mar 11 00:38:25 2009 -0700
@@ -1083,17 +1083,20 @@
PolynomialRing_general.__init__(self, base_ring, name=name,
sparse=sparse, element_class=element_class)
- def quotient_by_principal_ideal(self, f, names=None):
+ def quotient_by_principal_ideal(self, f, name=None):
"""
Return the quotient of this polynomial ring by the principal ideal
generated by `f`.
EXAMPLES:
"""
+ if name is None:
+ raise TypeError, "You must specify the generator name"
+
import sage.rings.polynomial.polynomial_quotient_ring
if not sage.rings.polynomial.polynomial_element.is_Polynomial(f):
f = f.gen() # Assume it's an ideal...
- return sage.rings.polynomial.polynomial_quotient_ring.PolynomialQuotientRing(self, f, names)
+ return sage.rings.polynomial.polynomial_quotient_ring.PolynomialQuotientRing(self, f, name)