PrevUpHomeNext

Extractor

Introduction
Concept Requirements
Notes

An Extractor is a class which Boost.Python can use to extract C++ objects from Python objects, and is typically used by facilities that define from_python conversions for "traditional" Python extension types.

In the table below, X denotes a model of Extractor and a denotes an instance of a Python object type.

Expression

Type

Semantics

X::execute(a)

non-void

Returns the C++ object being extracted. The execute function must not be overloaded.

&a.ob_type

PyTypeObject**

Points to the ob_type field of an object which is layout-compatible with PyObject

Informally, an Extractor's execute member must be a non-overloaded static function whose single argument is a Python object type. Acceptable Python object types include those publicly (and unambiguously) derived from PyObject, and POD types which are layout-compatible with PyObject.


PrevUpHomeNext