private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Nov 14 23:31:32 CET 2007


En Wed, 14 Nov 2007 15:08:42 -0300, <sndive at gmail.com> escribió:

> thank you.
> result is the same however:
> pyt: main.cpp:17: PyObject* pyNode_root(PyObject*, PyObject*):
> Assertion `co' failed.

Well, "is the same" in the sense that the code still doesn't do what you  
want... But the previous error is gone. (Now I regret having said the  
reason it didn't work before: you took my words too literally).

I suggest you first try to write the program in pure Python, even with a  
dummy Node. From what I can understand of what you are doing, it appears  
you don't fully understand how import works, how modules work, and  
namespaces in Python. The C API exposes the same concepts so it's easier  
when one knows how to do things in pure Python first. Right now you have  
two problems: "what" to do, and "how" to write that using the API. First  
try to solve the "what", in Python, and only later move to the second  
stage.

-- 
Gabriel Genellina




More information about the Python-list mailing list