7 #ifndef MDS_UTILS_PYTHON_TUPLE_HPP_INCLUDED 8 #define MDS_UTILS_PYTHON_TUPLE_HPP_INCLUDED 51 static PyObject* new_seq(
size_t len) {
52 return PyTuple_New(len);
55 static bool self_type_check(
const Obj& o) {
56 return PyTuple_Check(o);
60 bool set_item(
size_t pos,T
const& x) {
Proxy class for managing attribute access.
Tuple(Tuple &&rhs)
The move constructor.
Tuple(const Tuple &rhs)
The copy constructor.
PyObject * to_python(void)
Converts a value into a Python object.
Main namespace of all Michele De Stefano's C++ utilities.
Contains a wrapper class for a generic Python sequence datatype.
PyObject * m_po
Underlying pointer to the wrapped Python object.
size_t len() const
Returns the length of the sequence.
Tuple(size_t len)
Builds a tuple of specified length but with uninitialized elements.
Tuple & operator=(Tuple &&rhs)
The move assignment.
Tuple(PyObject *po)
Constructs a new Tuple from a Python sequence.
Tuple()
The default constructor.
Sequence_Base< Derived > & operator=(Sequence_Base< Derived > &&rhs)
Move assignment.
Tuple(ProxyAttr &&rhs)
The move constructor from ProxyAttr objects.
Base class for all generic sequence types.
This is a simple wrapper around the PyObject* datatype.