Ticket #12517: trac_12715.patch

File trac_12715.patch, 1.5 KB (added by William Stein, 11 years ago)
  • sage/schemes/elliptic_curves/constructor.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1329335218 28800
    # Node ID 5f62ab8b935963f447f8691d5cf3e7a929c045b1
    # Parent  cd3cbae8103daad8643a9d8182dd91ebaa57f5eb
    Trac #12715: EllipticCurve(E.a_invariants()) doesn't work
    
    diff --git a/sage/schemes/elliptic_curves/constructor.py b/sage/schemes/elliptic_curves/constructor.py
    a b  
    6262      `j`.  Warning: this is deprecated.  Use ``EllipticCurve_from_j(j)``
    6363      or ``EllipticCurve(j=j)`` instead.         
    6464
     65    In each case above where the input is a list of length 2 or 5, one
     66    can instead give a 2 or 5-tuple instead.
    6567   
    6668    EXAMPLES: We illustrate creating elliptic curves.
    6769   
     
    212214        sage: type(E)
    213215        <class 'sage.schemes.elliptic_curves.ell_field.EllipticCurve_field'>
    214216
     217    See trac #12517::
    215218
     219        sage: E = EllipticCurve([1..5])
     220        sage: EllipticCurve(E.a_invariants())
     221        Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 4*x + 5 over Rational Field
    216222    """
    217223    import ell_generic, ell_field, ell_finite_field, ell_number_field, ell_rational_field, ell_padic_field  # here to avoid circular includes
    218224   
     
    318324        k=j-1728
    319325        return EllipticCurve(F, [0,0,0,-3*j*k, -2*j*k**2])
    320326
    321     if not isinstance(x,list):
     327    if not isinstance(x, (list, tuple)):
    322328        raise TypeError, "invalid input to EllipticCurve constructor"
    323329
    324330    x = Sequence(x)