Ticket #5482: sage-5482.patch

File sage-5482.patch, 1.6 KB (added by Justin Walker, 14 years ago)
  • sage/rings/polynomial/polynomial_ring.py

    # HG changeset patch
    # User Justin C. Walker <justin@mac.com>
    # 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 b  
    10831083        PolynomialRing_general.__init__(self, base_ring, name=name,
    10841084                sparse=sparse, element_class=element_class)
    10851085
    1086     def quotient_by_principal_ideal(self, f, names=None):
     1086    def quotient_by_principal_ideal(self, f, name=None):
    10871087        """
    10881088        Return the quotient of this polynomial ring by the principal ideal
    10891089        generated by `f`.
    10901090       
    10911091        EXAMPLES:
    10921092        """
     1093        if name is None:
     1094            raise TypeError, "You must specify the generator name"
     1095       
    10931096        import sage.rings.polynomial.polynomial_quotient_ring
    10941097        if not sage.rings.polynomial.polynomial_element.is_Polynomial(f):
    10951098            f = f.gen()        # Assume it's an ideal...
    1096         return sage.rings.polynomial.polynomial_quotient_ring.PolynomialQuotientRing(self, f, names)
     1099        return sage.rings.polynomial.polynomial_quotient_ring.PolynomialQuotientRing(self, f, name)
    10971100   
    10981101
    10991102