[Cython] Assignments in cdefs

Stefan Behnel stefan_ml at behnel.de
Sun Jul 20 21:33:02 CEST 2008


Dag Sverre Seljebotn wrote:
> Dag Sverre Seljebotn wrote:
>> Stefan Behnel wrote:
>>> Then what exactly is your "ref-counting optimisation" doing? Can you give me a
>>> code example?
>> It makes "cdef int x = 3" behave as before, no more or less. Just 
>> refactoring the code so that buffer worked. I needed to put the stuff 
>> that handled the difference in refcounting somewhere, and that somewhere 
>> leaves a hole in which to plug further improvements, so it was a natural 
>> name, but it doesn't mean that it is more optimized than it used to be.
>>
> 
> Sorry! I meant
> 
> cdef MyExtensionsType a = x
> 
> (as int isn't refcounted...).

Ok, I just checked that there's a test case for this (run/cdefassign), and it
still seems to generate the correct and optimised code on your branch. So I'm
fine with your change.

Stefan


More information about the Cython-dev mailing list