Stefan Behnel wrote:
> Dag Sverre Seljebotn, 03.12.2009 12:45:
>   
>>>>> cdef double f(): ...
>>>>> x = f() # infer x as double
>>>>>           
>>>   
>>>       
>> This is now http://trac.cython.org/cython_trac/ticket/460.
>>     
>
> Note that I closed ticket 236, so you can now call a Python method on a
> corresponding C type, as in
>
>     cdef int i = 1
>     print i.__add__(1)
>     print i.bit_length() # Py3.1
>
> It's implemented through coercion to a Python object. If we find an
> important use case where this isn't fast enough (after all, this is a very
> rare use case anyway), we can always add a specific handler in Optimize.py.
> As this didn't work at all before, I don't expect it to break code either
> (although I had to fix one test case that tested for the original error...)
>   
Thanks! Heh, well, it certainly feels suboptimal to have "myfloat.imag", 
guaranteed to be 0, go through Python. Then again, who would ever call 
it? I'm perfectly fine with this.

Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to