Introduction

Exposes the generic Python object wrapper class object,
and related classes. In order to avoid some potenential problems with
argument-dependent lookup and the generalized operators defined on
object, all these facilities are defined in
namespace boost::python::api, and object
is imported into namespace boost::python with a
using-declaration.

Types

class slice_nil;
static const _ = slice_nil();

A type that can be used to get the effect of leaving out an index in a
Python slice expression:

>>> x[:-1]
>>> x[::-1]

C++ equivalent:

x.slice(_,-1)
x[slice(_,_,-1)]

Classes

Class
const_attribute_policies

The policies which are used for proxies representing an attribute
access to a const object.

Class template
object_operators<U>

This is the base class of object and its
proxy template used to supply common interface: member
functions, and operators which must be defined within the class body. Its
template parameter U is expected to be a class derived from
object_operators<U>. In practice users should never
use this class directly, but it is documented here because it supplies
important interface to object and its proxies.

Effects: accesses the slice of *this indicated
by std::make_pair(object(start), object(finish)).

Returns: a proxy object which binds
object(*static_cast<U*>(this)) as its target, and
std::make_pair(object(start), object(finish)) as its
key.

Class object

The intention is that object acts as much like a
Python variable as possible. Thus expressions you'd expect to work
in Python should generally work in the same way from C++. Most of
object's interface is provided by its base class
object_operators<object>,
and the free functions defined in this
header.