[Cython] Cython 0.15.1 release candidate

Stefan Behnel stefan_ml at behnel.de
Fri Sep 16 23:29:53 CEST 2011


mark florisson, 16.09.2011 23:21:
> On 16 September 2011 22:20, mark florisson wrote:
>> On 16 September 2011 22:03, Stefan Behnel wrote:
>>> Robert Bradshaw, 15.09.2011 22:33:
>>>>
>>>> See http://wiki.cython.org/ReleaseNotes-0.15.1 This is a bugfix only
>>>> release, we hope to get it out shortly.
>>>
>>> I've added ticket 736 as a blocker, at least until I know what it takes to
>>> fix it (looking into it right now).
>>>
>>> http://trac.cython.org/cython_trac/ticket/736
>>
>> Looking at the generated code I see
>>
>> __pyx_cur_scope->__pyx_v_a = __pyx_k_1;
>> __pyx_cur_scope->__pyx_v_b = __pyx_k_2;
>>
>> happening at unpacking time without a corresponding INCREF. Surely the
>> scope object should only ever own references and never borrow them?
>> The arguments from the args tuple are increffed however, just not the
>> default values.

Yes, I noticed that. See the updated bug description. I just wasn't sure 
what the best fix was when I wrote the above.

By now, I'm quite sure that it would be best to do the same as for the 
keyword arguments, i.e. store the borrowed values in a temporary array and 
copy them over when everything has worked out correctly.


> BTW, the test would be better written with a class like
>
> class UniqueObject(object):
>      def __init__(self, value):
>          self.value = value
>      def __repr__(self):
>          return repr(self.value)
>
> That makes it easier to track down refcount errors than (small) integers.

The refnanny handles that for us quite nicely.

Stefan


More information about the cython-devel mailing list