Ticket #13538: trac_13538.patch

File trac_13538.patch, 2.1 KB (added by saraedum, 10 years ago)
  • sage/categories/pushout.py

    # HG changeset patch
    # User Julian Rueth <julian.rueth@gmail.com>
    # Date 1348676190 0
    # Node ID 7ffe38b585130075a207b9069d9f0d72c0e231d6
    # Parent  698ec14c513f99fa5a3a7aeca982cc14fd249a89
    Trac 13538: AlgebraicExtensionFunctor does not make an assumption on the args order
    
    diff --git a/sage/categories/pushout.py b/sage/categories/pushout.py
    a b class AlgebraicExtensionFunctor(ConstructionFunctor): 
    25692569    def _apply_functor(self, R):
    25702570        """
    25712571        Apply the functor to an object of ``self``'s domain.
    2572        
     2572
    25732573        TESTS::
    25742574
    25752575            sage: K.<a>=NumberField(x^3+x^2+1)
    class AlgebraicExtensionFunctor(ConstructionFunctor): 
    25802580            Univariate Quotient Polynomial Ring in a over Univariate Polynomial Ring in t over Integer Ring with modulus a^3 + a^2 + 1
    25812581            sage: F(RR)       # indirect doctest
    25822582            Univariate Quotient Polynomial Ring in a over Real Field with 53 bits of precision with modulus a^3 + a^2 + 1.00000000000000
     2583
     2584        Check that #13538 is fixed::
     2585
     2586            sage: K = Qp(3,3)
     2587            sage: R.<a> = K[]
     2588            sage: AEF = sage.categories.pushout.AlgebraicExtensionFunctor([a^2-3], ['a'], [None])
     2589            sage: AEF(K)
     2590            Eisenstein Extension of 3-adic Field with capped relative precision 3 in a defined by (1 + O(3^3))*a^2 + (O(3^4))*a + (2*3 + 2*3^2 + 2*3^3 + O(3^4))
     2591
    25832592        """
    25842593        from sage.all import QQ, ZZ, CyclotomicField
    25852594        if self.cyclotomic:
    class AlgebraicExtensionFunctor(ConstructionFunctor): 
    25882597            if R==ZZ:
    25892598                return CyclotomicField(self.cyclotomic).maximal_order()
    25902599        if len(self.polys) == 1:
    2591             return R.extension(self.polys[0], self.names[0], embedding=self.embeddings[0])
    2592         return R.extension(self.polys, self.names, embedding=self.embeddings)
     2600            return R.extension(self.polys[0], names=self.names[0], embedding=self.embeddings[0])
     2601        return R.extension(self.polys, names=self.names, embedding=self.embeddings)
    25932602
    25942603    def __cmp__(self, other):
    25952604        """