Thanks for the suggestion. I haven't looked at PyCXX yet. I'll definitely check 
it out sometime. In light of your and other people's replies, I probably will 
postpone the development till I think it through, especially after another day 
of trying and failing. 

I do have one question for you, and for anyone who is kind enough to read this: 
how can I know if a PyObject_Call(...) or PyObject_GetAttr(...) returns a new 
ref or a borrowed ref? I read online ( Python 3 ) that they are returning new 
references. But does everyone comply with it? If so, it seems safe for me to 
capture the return PyObject* into a wrapper class that automatically 
Py_DECREF() upon destruction. But if not, what documentations should I refer to 
for the behavior of a specific python module ( for example, matplotlib )?

This is the first time I ever checked out the Python C API, I guess I'm in need 
of some conventions here. Your input is much appreciated.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/CFYYKFBEBEVOPDQPKEGNF7XDDL5AZEG5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to