18 PyErr_Format( PyExc_NotImplementedError,
19 "no __setitem__ handler for return type (%s)",
34 int nArgs = PyTuple_GET_SIZE( args );
36 PyErr_SetString( PyExc_TypeError,
"insufficient arguments to __setitem__" );
41 ((
TRefExecutor*)this->GetExecutor())->SetAssignable( PyTuple_GET_ITEM( args, nArgs - 1 ) );
42 PyObject* subset = PyTuple_GetSlice( args, 0, nArgs - 1 );
46 for (
int i = 0; i < nArgs - 1; ++i ) {
47 PyObject* item = PyTuple_GetItem( subset, i );
48 realsize += PyTuple_Check( item ) ? PyTuple_GET_SIZE( item ) : 1;
53 if ( realsize != nArgs - 1 ) {
54 unrolled = PyTuple_New( realsize );
57 for (
int i = 0; i < nArgs - 1; ++i, ++current ) {
58 PyObject* item = PyTuple_GetItem( subset, i );
59 if ( PyTuple_Check( item ) ) {
60 for (
int j = 0; j < PyTuple_GET_SIZE( item ); ++j, ++current ) {
61 PyObject* subitem = PyTuple_GetItem( item, j );
63 PyTuple_SetItem( unrolled, current, subitem );
67 PyTuple_SetItem( unrolled, current, item );
74 Py_XDECREF( unrolled );
virtual PyObject * PreProcessArgs(ObjectProxy *&self, PyObject *args, PyObject *kwds)
verify existence of self, return if ok
std::string GetReturnTypeName()
virtual Bool_t InitExecutor_(TExecutor *&, TCallContext *ctxt=0)
install executor conform to the return type
virtual PyObject * PreProcessArgs(ObjectProxy *&self, PyObject *args, PyObject *kwds)
Prepare executor with a buffer for the return value.
virtual Bool_t InitExecutor_(TExecutor *&, TCallContext *ctxt=0)
install executor conform to the return type