static PyObject* Member_del_slot( Member* self, PyObject* object ) { if( !CAtom::TypeCheck( object ) ) return py_expected_type_fail( object, "CAtom" ); CAtom* atom = catom_cast( object ); if( self->index >= atom->get_slot_count() ) return py_no_attr_fail( object, PyString_AsString( self->name ) ); atom->set_slot( self->index, 0 ); Py_RETURN_NONE; }
static PyObject* Member_set_slot( Member* self, PyObject* args ) { if( PyTuple_GET_SIZE( args ) != 2 ) return py_type_fail( "set_slot() takes exactly 2 arguments" ); PyObject* object = PyTuple_GET_ITEM( args, 0 ); PyObject* value = PyTuple_GET_ITEM( args, 1 ); if( !CAtom::TypeCheck( object ) ) return py_expected_type_fail( object, "CAtom" ); CAtom* atom = catom_cast( object ); if( self->index >= atom->get_slot_count() ) return py_no_attr_fail( object, PyString_AsString( self->name ) ); atom->set_slot( self->index, value ); Py_RETURN_NONE; }