Yahoo Canada Web Search

Search results

  1. 3 days ago · This manual documents the API used by C and C++ programmers who want to write extension modules or embed Python. It is a companion to Extending and Embedding the Python Interpreter, which describes the general principles of extension writing but does not document the API functions in detail.

    • Importing Modules

      PyObject * PyImport_Import (PyObject * name) ¶ Return value:...

    • Introduction

      Most Python/C API functions have one or more arguments as...

    • Reflection

      Return value: Borrowed reference. Part of the Stable ABI ....

    • Mapping Protocol

      PyObject * PyMapping_Items (PyObject * o) ¶ Return value:...

  2. Most Python/C API functions have one or more arguments as well as a return value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data type representing an arbitrary Python object.

  3. Jul 16, 2023 · Types in CPython are defined by the _typeobject struct. This C struct is actually the base of all the types used in CPython and it has many fields that are mostly pointers to other C...

  4. Mar 11, 2010 · A few structure types are used to describe static tables used to list the functions exported by a module or the data attributes of a new object type, and another is used to describe the value of a complex number.

  5. Changing Python’s C API¶ The C API is divided into these tiers: The internal, private API, available with Py_BUILD_CORE defined. Ideally declared in Include/internal/. Any API named with a leading underscore is also considered private. The Unstable C API, identified by the PyUnstable_ name prefix.

  6. .. c:function:: PyObject * PyObject_RichCompare (PyObject * o1, PyObject * o2, int opid) Compare the values of * o1 * and * o2 * using the operation specified by * opid *, which must be one of: c: macro:` Py_LT `, : c: macro:` Py_LE `, : c: macro:` Py_EQ `, : c: macro:` Py_NE `, : c: macro:` Py_GT `, or: c: macro:` Py_GE `, corresponding to ...

  7. People also ask

  8. The API is equally usable from C++, but for brevity it is generally referred to as the Python/C API. There are two fundamentally different reasons for using the Python/C API. The first reason is to write extension modules for specific purposes; these are C modules that extend the Python interpreter.