35 for (
int i = 0; i < nSize; ++i) {
37 if (PyList_SetItem(
mPtr, i, Py_None) == -1) {
63 virtual bool accepts(PyObject *pyob)
const {
64 return pyob !=
nullptr && PyList_Check(pyob);
86 if (PyList_Append(
mPtr, ob.
mPtr) == -1) {
Root of the PyCXX exception hierarchy.
Definition exception.h:19
Temporary owner of a new reference returned by the CPython API.
Definition fromapi.h:25
List(const Object &ob)
Take another handle's reference as a list.
Definition list.h:51
List(int nSize=0)
Create a list of a given length.
Definition list.h:32
virtual bool accepts(PyObject *pyob) const
Accept only a list.
Definition list.h:63
void append(const Object &ob)
Append one element.
Definition list.h:85
virtual int capacity() const
Report the sentinel rather than the length, as Py::String does.
Definition list.h:74
Reference-counted handle on any Python object, and the root of the PyCXX object hierarchy.
Definition object.h:42
void set(PyObject *pyob)
Replace the reference with a borrowed one and add a count of its own.
Definition object.h:215
void validate()
Enforce this type's accepts() test on the stored reference.
Definition object.h:237
PyObject * mPtr
Wrapped reference, null only between release() and the next assignment.
Definition object.h:191
virtual int max_size() const
SeqBase()
Definition seqbase.h:47
Configuration header of the PyCXX binding layer.
C++ wrappers for the embedded Python interpreter's objects, types, and extension modules.
Definition attributeerror.h:7