//@requires: Exceptions.c::PyErrFetchRestore
//@requires: Exceptions.c::SwapException
//@requires: Exceptions.c::RaiseException
+//@requires: ObjectHandling.c::PyObjectCallMethod
static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
if (value == Py_None)
ret = PyIter_Next(yf);
else
- ret = PyObject_CallMethod(yf, (char*)"send", (char*)"O", value);
+ ret = __Pyx_PyObject_CallMethod1(yf, PYIDENT("send"), value);
}
gen->is_running = 0;
//Py_DECREF(yf);
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
}
+
+/////////////// PyObjectCallMethod.proto ///////////////
+//@substitute: naming
+
+static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
+ PyObject *method, *result = NULL;
+ if (unlikely(!args)) return NULL;
+ method = PyObject_GetAttr(obj, method_name);
+ if (unlikely(!method)) goto bad;
+ result = PyObject_Call(method, args, NULL);
+ Py_DECREF(method);
+bad:
+ Py_DECREF(args);
+ return result;
+}
+
+#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
+ __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3));
+#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
+ __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2));
+#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
+ __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1));
+#define __Pyx_PyObject_CallMethod0(obj, name) \
+ __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF($empty_tuple), $empty_tuple));
/////////////// append ///////////////
//@requires: ListAppend
+//@requires: ObjectHandling.c::PyObjectCallMethod
static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
if (likely(PyList_CheckExact(L))) {
Py_INCREF(Py_None);
return Py_None; /* this is just to have an accurate signature */
} else {
- return PyObject_CallMethodObjArgs(L, PYIDENT("append"), x, NULL);
+ return __Pyx_PyObject_CallMethod1(L, PYIDENT("append"), x);
}
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L); /*proto*/
/////////////// pop ///////////////
+//@requires: ObjectHandling.c::PyObjectCallMethod
static CYTHON_INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02040000
}
#endif
#endif
- return PyObject_CallMethodObjArgs(L, PYIDENT("pop"), NULL);
+ return __Pyx_PyObject_CallMethod0(L, PYIDENT("pop"));
}
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); /*proto*/
/////////////// dict_setdefault ///////////////
+//@requires: ObjectHandling.c::PyObjectCallMethod
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type) {
PyObject* value;
Py_INCREF(value);
#endif
} else {
- value = PyObject_CallMethodObjArgs(d, PYIDENT("setdefault"), key, default_value, NULL);
+ value = __Pyx_PyObject_CallMethod2(d, PYIDENT("setdefault"), key, default_value);
}
return value;
}
/////////////// dict_iter ///////////////
//@requires: ObjectHandling.c::UnpackTuple2
//@requires: ObjectHandling.c::IterFinish
+//@requires: ObjectHandling.c::PyObjectCallMethod
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_source_is_dict) {
*p_orig_length = 0;
if (method_name) {
PyObject* iter;
- iterable = PyObject_CallMethodObjArgs(iterable, method_name, NULL);
+ iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
if (!iterable)
return NULL;
#if !CYTHON_COMPILING_IN_PYPY