C++ version of the C Python API?

"Martin v. Löwis" martin at v.loewis.de
Mon Oct 22 15:52:22 EDT 2007


> This preference, in
> turn, is what motivated my original question. The CPython API
> interface itself seems modularized, NOT object oriented (only from
> what I saw). 

I suggest you look again, then. Things like PyObject_String,
PyObject_GetAttrString, or PySequence_GetItem all express the
object-orientation in the API. The hide the actual implementation
of how string conversion is done, how attribute names are converted
to attribute values, and how an item in an enumerable sequence is
accessed. They exhibit polymorphism, late binding, and encapsulation,
which are among the core properties of object-orientation. The
C API (although not these three functions) also supports inheritance,
which is the core property missing in the previous list.

Regards,
Martin





More information about the Python-list mailing list