[Cython] Accessing C attributes from Python functions in the interpreter

Stefan Behnel stefan_ml at behnel.de
Thu Jun 12 07:44:18 CEST 2008


Hi,

Johannes Wienke wrote:
> My data is set by an external library that I
> have opened before. I've also double-checked that it is set. But somehow
> in another self than the one used when calling the data.

I see two possibilities:

a) It's not the same object. Try to make sure that you don't re-create it
somewhere else. (e.g. put a __cinit__ method in there and print "I'm alive!")

b) You call the method from C code or otherwise by hand and pass the wrong
instance as self. Print the type of the object that self points to when the
method is called.

Stefan



More information about the Cython-dev mailing list