Python/C API Reference Manual?
https://docs.python.org/3/c-api/index.html
Extending and Embedding the Python Interpreter?
https://docs.python.org/3/extending/
1) include Python.h before any standard headers are included.
2) Stealing a reference means that when you pass a reference to a function, that function assumes that it now owns that reference, and you are not responsible for it any longer
3) When no ownership is transferred, the caller is said to borrow the reference. Nothing needs to be done for a borrowed reference.
4) in many cases, the returned object is created on the fly, and the reference you get is the only reference to the object.
5) the one owns the reference is responsible to deref it
others:
http://blog.csdn.net/fatshaw/article/details/6152900
http://blog.csdn.net/marising/article/details/2845339
hybrid programming based on python and C/C++
原文:http://www.cnblogs.com/resibe-3/p/6423604.html