seg. fault with ext. module

Gorny gorny at
Sat Aug 25 18:56:08 CEST 2001

> Yes (sort of). The function returns a reference to an existing object
> without updating the ref count. The caller (the Interpreter) will
> decrement the ref count, when this reference gets out of scope,
> which means in this case `None' is disposed too early, because it was
> used more often than the ref count said. (Someone with more insight
> can explain why this creates a segfault.)

;-) allright, I got the point.. thanks

> Yes. If you return a reference to an existing object, you have to
> increment the ref count. If you create a new object (e.g. with
> Py_BuildValue()), you just pass the reference to the caller.
> /steffen

thanks again


"When I was a little kid, I had this dream where a snake would rule and
the entire world (actually, I guess that a penguin was also part of the
but never mind)" -- Python Develper's Handbook, Andre Lessa

More information about the Python-list mailing list