[Cython] "__ipow__ has wrong number of arguments" is back here
robertwb at math.washington.edu
Thu Mar 3 22:05:19 CET 2011
On Wed, Mar 2, 2011 at 5:47 PM, Lisandro Dalcin <dalcinl at gmail.com> wrote:
> On 2 March 2011 17:14, Lisandro Dalcin <dalcinl at gmail.com> wrote:
>> On 2 March 2011 16:18, Vitja Makarov <vitja.makarov at gmail.com> wrote:
>>> I noticed that this error came back again.
>> I've pushed a fix for __ipow__ to take just two arguments, like
>> regular Python classes.
>> But I forgot to update test for ticket #561, now this should fixed:
> BTW, do you all agree with this change?
To summarize, the C signature of ipow takes three arguments, but the
third is often/always garbage, so we shouldn't use it?
> I expect this change to break some code, particularly in Sage...
It'll be a compile time error fixing a potential runtime crash, so I
think that's a good move. Unfortunately the sage-build is still broken
due to the fixes for http://trac.cython.org/cython_trac/ticket/654 ,
but I doubt we use ipow much for two reasons: firstly, most of our
objects are immutable, and secondly rather than taking a "modulus" as
a third argument for power, the way to do this is to power an element
of the appropriate ring, e.g. mod(2, 17)*1000.
More information about the cython-devel