Stefan Behnel, 13.01.2011 16:32:
> Stefan Behnel, 13.01.2011 15:53:
>> Sébastien Sablé, 13.01.2011 13:45:
>>> #cython: infer_types=True
>>>
>>> cdef get_field_flags():
>>>         flags = []
>>>         append = flags.append
>>>         append('fetched')
>>>              ^
>>> ------------------------------------------------------------
>>>
>>> magnum/magpy.pyx:6:10: Call with wrong number of arguments (expected 2,
>>> got 1)
>>>
>>> The same code would work great with cython 0.13 and it would work with
>>> 0.14.1 if I remove the infer_types=True line.
>>
>> Thanks for the report. It's quite possible that the type inference
>> mechanism now assumes that the bound method is actually the C-API function
>> replacement, i.e. the C function PyList_Append(). That's the wrong thing to
>> infer here as it cannot be made to work.
>
> Here's another related problem:
>
>       # cython: infer_types=True
>
>       cdef int func(int x):
>           return x+2
>
>       def inferred():
>           f = func
>
> 'f' is inferred as C function, not as function pointer.
>
> http://trac.cython.org/cython_trac/ticket/643
> http://trac.cython.org/cython_trac/ticket/644

Fixes are here:

https://github.com/cython/cython/commit/3ac5fb86833de2831e72bd368fab6b6f1fb03ec2

https://github.com/cython/cython/commit/48177ec6f603d7ae88ee6302bfe5c4c299cd350a

Stefan
_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to