提交 b851807f authored 作者: pl's avatar pl

Replaced the Python C-API introduction paragraph with suggestion from reviewer

上级 21dddad9
...@@ -25,12 +25,11 @@ vector by a scalar. ...@@ -25,12 +25,11 @@ vector by a scalar.
Python C-API Python C-API
============ ============
Python provides a C-API to allow the manipulation of Python objects from Python provides a C-API to allows the manipulation of python objects from C
C code. In this API, all classes that represent Python objects are descendants code. In this API, all variables that represent Python objects are of type
of the class PyObject. This class is essentially a wrapper; an instance of `PyObject *`. All objects have a pointer to their type object and a reference
PyObject contains a pointer to another object as well as a reference count count field (that is shared with the python side). Most python methods have
for that object. Thus, an instance of PyObject allows to treat a pointer to an an equivalent C function that can be called on the `PyObject *` pointer.
object as an object itself.
As such, manipulating a PyObject instance is often straight-forward but it As such, manipulating a PyObject instance is often straight-forward but it
is important to properly manage its reference count. Failing to do so can is important to properly manage its reference count. Failing to do so can
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论