resonance 1.0.1
Loading...
Searching...
No Matches
Py Namespace Reference

C++ wrappers for the embedded Python interpreter's objects, types, and extension modules. More...

Classes

class  AttributeError
 Exception for a missing attribute, mirroring Python's AttributeError. More...
class  Callable
 Handle on any callable Python object. More...
class  Char
 Handle on a one-character Python string, and the element type of Py::String. More...
class  Dict
 Handle on a Python dictionary. More...
class  Exception
 Root of the PyCXX exception hierarchy. More...
class  ExtensionModuleBase
 Base of an extension module the binding registers with the interpreter. More...
class  ExtensionModuleBasePtr
 Python-visible wrapper that points back at an extension module's C++ object. More...
class  Float
 Handle on a Python float. More...
class  FromAPI
 Temporary owner of a new reference returned by the CPython API. More...
class  Int
 Handle on a Python integer. More...
class  KeyError
 Exception for a missing mapping key, mirroring Python's KeyError. More...
class  List
 Handle on a Python list. More...
class  LookupError
 Intermediate of the PyCXX exception hierarchy, mirroring Python's LookupError. More...
class  MapBase
 Handle on any Python mapping, and the base of Py::Dict. More...
class  MethodDefExt
 Method record of an extension type, keyed by name in PythonExtension::methods(). More...
class  MethodTable
 Accumulator for the method table of an extension module. More...
class  Module
 Handle on a Python module. More...
class  NameError
 Exception for an unresolved name, mirroring Python's NameError. More...
class  Object
 Reference-counted handle on any Python object, and the root of the PyCXX object hierarchy. More...
class  PythonExtension
 Curiously recurring base that gives a C++ class its Python extension type. More...
class  PythonExtensionBase
 Base of every C++ object the binding exposes to Python as an extension object. More...
class  PythonType
 Builder for the CPython type object of an extension type. More...
class  RuntimeError
 Exception for a binding rule broken at run time, mirroring Python's RuntimeError. More...
class  SeqBase
 Handle on any Python sequence, and the base of Py::List, Py::Tuple, and Py::String. More...
class  seqref
 Proxy for one element of a sequence, which SeqBase::operator[]() returns. More...
class  StandardError
 Intermediate of the PyCXX exception hierarchy, mirroring Python's StandardError. More...
class  String
 Handle on a Python string. More...
class  Tuple
 Handle on a Python tuple. More...
class  Type
 Handle on a Python type object. More...
class  TypeError
 Exception for a value of the wrong Python type, mirroring Python's TypeError. More...

Typedefs

typedef SeqBase< Object > Sequence
 The sequence handle over plain objects, as released PyCXX spells it.

Functions

PyMethodDef method (const char *pszMethodName, PyCFunction pfnMethod, int nFlags=1, const char *pszDoc=nullptr)
 Build a method record for MethodTable::add().
PyObject * new_reference_to (const Object &object)
 Produce an owned reference from a handle, for returning to the interpreter.

Detailed Description

C++ wrappers for the embedded Python interpreter's objects, types, and extension modules.

Typedef Documentation

◆ Sequence

The sequence handle over plain objects, as released PyCXX spells it.

Function Documentation

◆ method()

PyMethodDef Py::method ( const char * pszMethodName,
PyCFunction pfnMethod,
int nFlags = 1,
const char * pszDoc = nullptr )
inline

Build a method record for MethodTable::add().

A free function rather than a member, and inline, so it has no address of its own. Its shape comes from MethodTable::add(), which assembles the four words on its own stack in this order before handing them to the vector.

Parameters
pszMethodNameThe Python-visible name.
pfnMethodThe C entry point.
nFlagsThe calling convention flag, which every recovered registration passes as 1.
pszDocThe doc string.
Returns
The record.

◆ new_reference_to()

PyObject * Py::new_reference_to ( const Object & object)
inline

Produce an owned reference from a handle, for returning to the interpreter.

Parameters
objectThe handle to read.
Returns
The reference with one count added, which the caller then owns.
Ghidra address:
NTSC-U/C: 0x004c6f28
Ghidra address:
PAL: 0x00505150