Hi,

Here's a snippet demonstrating a refcount error with fused types inside
classes:

---------8<---------
cimport cython

ctypedef fused some_t:
    int
    double

class Foo(object):
    def bar(self, some_t x):
        pass

cdef extern from "Python.h":
    int Py_REFCNT(object)

def main():
    x = Foo()
    print "before:", Py_REFCNT(x)
    x.bar(1.0) # spuriously increments refcount of `x`
    print "after: ", Py_REFCNT(x)
---------8<---------


-- 
Pauli Virtanen

_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to