Changes between Initial Version and Version 1 of Ticket #22321


Ignore:
Timestamp:
Feb 7, 2017, 2:09:20 PM (6 years ago)
Author:
Jeroen Demeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22321

    • Property Type changed from PLEASE CHANGE to enhancement
    • Property Summary changed from pow broken for PARI exponents to Gen.__init__() does not work as expected
  • Ticket #22321 – Description

    initial v1  
    1 the `Integer.__pow__(self, n, modulus)` assumes that `n` is either an integer, or a Sage `Element`. This breaks with the latest changes to the PARI interface:
    2 
     1For most types, the following would work, but it does not for `Gen`:
    32{{{
    4 sage: 1^pari(1.0)
     3sage: t = type(pari(2))
     4sage: t(2)
    55---------------------------------------------------------------------------
    66TypeError                                 Traceback (most recent call last)
    7 <ipython-input-3-87bc840c4f35> in <module>()
    8 ----> 1 Integer(1)**pari(RealNumber('1.0'))
    9 
    10 /data/dfl/sage/src/sage/rings/integer.pyx in sage.rings.integer.Integer.__pow__ (/data/dfl/sage/src/build/cythonized/sage/rings/integer.c:13909)()
    11    2029             nn = pyobject_to_long(n)
    12    2030         except TypeError:
    13 -> 2031             s = parent_c(n)(self)
    14    2032             return s**n
    15    2033         except OverflowError:
     7<ipython-input-2-35638e9214b8> in <module>()
     8----> 1 t(Integer(2))
    169
    1710TypeError: __init__() takes exactly 0 positional arguments (1 given)
    1811}}}
     12
     13It makes sense to change this but it will require some refactoring of the `new_gen` mechanism.