@@ -193,6 +193,10 @@ static PyObject* wrap_richcmpfunc(richcmpfunc f, PyObject* a, PyObject* b, PyObj
193
193
return f (explicit_cast (a ), explicit_cast (b ), (int )PyLong_AsLong (n ));
194
194
}
195
195
196
+ static PyObject * wrap_ssizeobjargproc (ssizeobjargproc f , PyObject * a , PyObject * size , PyObject * b ) {
197
+ return PyLong_FromLong (f (explicit_cast (a ), PyLong_AsSsize_t (size ), explicit_cast (b )));
198
+ }
199
+
196
200
int PyType_Ready (PyTypeObject * cls ) {
197
201
#define ADD_IF_MISSING (attr , def ) if (!(attr)) { attr = def; }
198
202
#define ADD_METHOD (m ) ADD_METHOD_OR_SLOT(m.ml_name, get_method_flags_cwrapper(m.ml_flags), m.ml_meth, m.ml_flags, m.ml_doc)
@@ -416,7 +420,7 @@ int PyType_Ready(PyTypeObject* cls) {
416
420
ADD_SLOT ("__add__" , sequences -> sq_concat , -2 );
417
421
ADD_SLOT ("__mul__" , sequences -> sq_repeat , -2 );
418
422
ADD_SLOT ("__getitem__" , sequences -> sq_item , -2 );
419
- ADD_SLOT ("__setitem__" , sequences -> sq_ass_item , -3 );
423
+ ADD_SLOT_CONV ("__setitem__" , wrap_ssizeobjargproc , sequences -> sq_ass_item , -3 );
420
424
ADD_SLOT ("__contains__" , sequences -> sq_contains , -2 );
421
425
ADD_SLOT ("__iadd__" , sequences -> sq_inplace_concat , -2 );
422
426
ADD_SLOT ("__imul__" , sequences -> sq_inplace_repeat , -2 );
0 commit comments