Commit ad037f74 authored by Stefan Behnel's avatar Stefan Behnel

clean up C comments in CyFunction/Generator utility code files to avoid writing them out

parent aefd0a70
...@@ -29,14 +29,15 @@ typedef struct { ...@@ -29,14 +29,15 @@ typedef struct {
PyObject *func_globals; PyObject *func_globals;
PyObject *func_code; PyObject *func_code;
PyObject *func_closure; PyObject *func_closure;
PyObject *func_classobj; /* No-args super() class cell */ // No-args super() class cell
PyObject *func_classobj;
/* Dynamic default args and annotations */ // Dynamic default args and annotations
void *defaults; void *defaults;
int defaults_pyobjects; int defaults_pyobjects;
int flags; int flags;
/* Defaults info */ // Defaults info
PyObject *defaults_tuple; /* Const defaults tuple */ PyObject *defaults_tuple; /* Const defaults tuple */
PyObject *defaults_kwdict; /* Const kwonly defaults dict */ PyObject *defaults_kwdict; /* Const kwonly defaults dict */
PyObject *(*defaults_getter)(PyObject *); PyObject *(*defaults_getter)(PyObject *);
...@@ -97,8 +98,10 @@ static int ...@@ -97,8 +98,10 @@ static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{ {
PyObject *tmp = op->func_doc; PyObject *tmp = op->func_doc;
if (value == NULL) if (value == NULL) {
value = Py_None; /* Mark as deleted */ // Mark as deleted
value = Py_None;
}
Py_INCREF(value); Py_INCREF(value);
op->func_doc = value; op->func_doc = value;
Py_XDECREF(tmp); Py_XDECREF(tmp);
...@@ -244,7 +247,7 @@ __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { ...@@ -244,7 +247,7 @@ __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
if (unlikely(!res)) if (unlikely(!res))
return -1; return -1;
/* Cache result */ // Cache result
op->defaults_tuple = PyTuple_GET_ITEM(res, 0); op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
Py_INCREF(op->defaults_tuple); Py_INCREF(op->defaults_tuple);
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
...@@ -446,7 +449,7 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f ...@@ -446,7 +449,7 @@ static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int f
Py_INCREF(op->func_globals); Py_INCREF(op->func_globals);
Py_XINCREF(code); Py_XINCREF(code);
op->func_code = code; op->func_code = code;
/* Dynamic Default args */ // Dynamic Default args
op->defaults_pyobjects = 0; op->defaults_pyobjects = 0;
op->defaults = NULL; op->defaults = NULL;
op->defaults_tuple = NULL; op->defaults_tuple = NULL;
...@@ -555,8 +558,8 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) ...@@ -555,8 +558,8 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
} }
#if CYTHON_COMPILING_IN_PYPY #if CYTHON_COMPILING_IN_PYPY
/* originally copied from PyCFunction_Call() in CPython's Objects/methodobject.c */ // originally copied from PyCFunction_Call() in CPython's Objects/methodobject.c
/* PyPy does not have this function */ // PyPy does not have this function
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunctionObject* f = (PyCFunctionObject*)func;
PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyCFunction meth = PyCFunction_GET_FUNCTION(func);
...@@ -633,12 +636,12 @@ static PyTypeObject __pyx_CyFunctionType_type = { ...@@ -633,12 +636,12 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/ 0, /*tp_doc*/
(traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/
(inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/
0, /*tp_richcompare*/ 0, /*tp_richcompare*/
offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffset */ offsetof(__pyx_CyFunctionObject, func_weakreflist), /*tp_weaklistoffset*/
0, /*tp_iter*/ 0, /*tp_iter*/
0, /*tp_iternext*/ 0, /*tp_iternext*/
__pyx_CyFunction_methods, /*tp_methods*/ __pyx_CyFunction_methods, /*tp_methods*/
...@@ -803,7 +806,7 @@ __pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type) ...@@ -803,7 +806,7 @@ __pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
func = (__pyx_FusedFunctionObject *) self; func = (__pyx_FusedFunctionObject *) self;
if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) { if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) {
/* Do not allow rebinding and don't do anything for static methods */ // Do not allow rebinding and don't do anything for static methods
Py_INCREF(self); Py_INCREF(self);
return self; return self;
} }
...@@ -904,7 +907,7 @@ __pyx_err: ...@@ -904,7 +907,7 @@ __pyx_err:
if (self->self || self->type) { if (self->self || self->type) {
__pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func; __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func;
/* Todo: move this to InitClassCell */ // TODO: move this to InitClassCell
Py_CLEAR(unbound->func.func_classobj); Py_CLEAR(unbound->func.func_classobj);
Py_XINCREF(self->func.func_classobj); Py_XINCREF(self->func.func_classobj);
unbound->func.func_classobj = self->func.func_classobj; unbound->func.func_classobj = self->func.func_classobj;
...@@ -961,12 +964,12 @@ __pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw) ...@@ -961,12 +964,12 @@ __pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw)
return result; return result;
} }
/* Note: the 'self' from method binding is passed in in the args tuple, // Note: the 'self' from method binding is passed in in the args tuple,
whereas PyCFunctionObject's m_self is passed in as the first // whereas PyCFunctionObject's m_self is passed in as the first
argument to the C function. For extension methods we need // argument to the C function. For extension methods we need
to pass 'self' as 'm_self' and not as the first element of the // to pass 'self' as 'm_self' and not as the first element of the
args tuple. // args tuple.
*/
static PyObject * static PyObject *
__pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw) __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
{ {
...@@ -980,7 +983,7 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw) ...@@ -980,7 +983,7 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
int is_classmethod = binding_func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD; int is_classmethod = binding_func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD;
if (binding_func->self) { if (binding_func->self) {
/* Bound method call, put 'self' in the args tuple */ // Bound method call, put 'self' in the args tuple
Py_ssize_t i; Py_ssize_t i;
new_args = PyTuple_New(argc + 1); new_args = PyTuple_New(argc + 1);
if (!new_args) if (!new_args)
...@@ -998,7 +1001,7 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw) ...@@ -998,7 +1001,7 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
args = new_args; args = new_args;
} else if (binding_func->type) { } else if (binding_func->type) {
/* Unbound method call */ // Unbound method call
if (argc < 1) { if (argc < 1) {
PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given."); PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given.");
return NULL; return NULL;
...@@ -1081,7 +1084,7 @@ static PyTypeObject __pyx_FusedFunctionType_type = { ...@@ -1081,7 +1084,7 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
0, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /*tp_flags*/
0, /*tp_doc*/ 0, /*tp_doc*/
(traverseproc) __pyx_FusedFunction_traverse, /*tp_traverse*/ (traverseproc) __pyx_FusedFunction_traverse, /*tp_traverse*/
(inquiry) __pyx_FusedFunction_clear,/*tp_clear*/ (inquiry) __pyx_FusedFunction_clear,/*tp_clear*/
...@@ -1091,8 +1094,8 @@ static PyTypeObject __pyx_FusedFunctionType_type = { ...@@ -1091,8 +1094,8 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
0, /*tp_iternext*/ 0, /*tp_iternext*/
0, /*tp_methods*/ 0, /*tp_methods*/
__pyx_FusedFunction_members, /*tp_members*/ __pyx_FusedFunction_members, /*tp_members*/
/* __doc__ is None for the fused function type, but we need it to be */ // __doc__ is None for the fused function type, but we need it to be
/* a descriptor for the instance's __doc__, so rebuild descriptors in our subclass */ // a descriptor for the instance's __doc__, so rebuild descriptors in our subclass
__pyx_CyFunction_getsets, /*tp_getset*/ __pyx_CyFunction_getsets, /*tp_getset*/
&__pyx_CyFunctionType_type, /*tp_base*/ &__pyx_CyFunctionType_type, /*tp_base*/
0, /*tp_dict*/ 0, /*tp_dict*/
...@@ -1133,11 +1136,12 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/ ...@@ -1133,11 +1136,12 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY #if CYTHON_COMPILING_IN_PYPY
if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { /* cdef classes */ if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
// cdef classes
return PyClassMethod_New(method); return PyClassMethod_New(method);
} }
#else #else
/* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */ // It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API
static PyTypeObject *methoddescr_type = NULL; static PyTypeObject *methoddescr_type = NULL;
if (methoddescr_type == NULL) { if (methoddescr_type == NULL) {
PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append"); PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append");
...@@ -1145,7 +1149,8 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { ...@@ -1145,7 +1149,8 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
methoddescr_type = Py_TYPE(meth); methoddescr_type = Py_TYPE(meth);
Py_DECREF(meth); Py_DECREF(meth);
} }
if (PyObject_TypeCheck(method, methoddescr_type)) { /* cdef classes */ if (PyObject_TypeCheck(method, methoddescr_type)) {
// cdef classes
PyMethodDescrObject *descr = (PyMethodDescrObject *)method; PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
#if PY_VERSION_HEX < 0x03020000 #if PY_VERSION_HEX < 0x03020000
PyTypeObject *d_type = descr->d_type; PyTypeObject *d_type = descr->d_type;
...@@ -1155,7 +1160,8 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { ...@@ -1155,7 +1160,8 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
return PyDescr_NewClassMethod(d_type, descr->d_method); return PyDescr_NewClassMethod(d_type, descr->d_method);
} }
#endif #endif
else if (PyMethod_Check(method)) { /* python classes */ else if (PyMethod_Check(method)) {
// python classes
return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
} }
else if (PyCFunction_Check(method)) { else if (PyCFunction_Check(method)) {
......
...@@ -10,7 +10,7 @@ static CYTHON_INLINE PyObject* __Pyx_Generator_Yield_From(__pyx_GeneratorObject ...@@ -10,7 +10,7 @@ static CYTHON_INLINE PyObject* __Pyx_Generator_Yield_From(__pyx_GeneratorObject
source_gen = PyObject_GetIter(source); source_gen = PyObject_GetIter(source);
if (unlikely(!source_gen)) if (unlikely(!source_gen))
return NULL; return NULL;
/* source_gen is now the iterator, make the first next() call */ // source_gen is now the iterator, make the first next() call
retval = Py_TYPE(source_gen)->tp_iternext(source_gen); retval = Py_TYPE(source_gen)->tp_iternext(source_gen);
if (likely(retval)) { if (likely(retval)) {
gen->yieldfrom = source_gen; gen->yieldfrom = source_gen;
...@@ -196,8 +196,8 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { ...@@ -196,8 +196,8 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
#if CYTHON_COMPILING_IN_PYPY #if CYTHON_COMPILING_IN_PYPY
// FIXME: what to do in PyPy? // FIXME: what to do in PyPy?
#else #else
/* Generators always return to their most recent caller, not // Generators always return to their most recent caller, not
* necessarily their creator. */ // necessarily their creator.
if (self->exc_traceback) { if (self->exc_traceback) {
PyThreadState *tstate = PyThreadState_GET(); PyThreadState *tstate = PyThreadState_GET();
PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
...@@ -224,9 +224,9 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) { ...@@ -224,9 +224,9 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
#if CYTHON_COMPILING_IN_PYPY #if CYTHON_COMPILING_IN_PYPY
// FIXME: what to do in PyPy? // FIXME: what to do in PyPy?
#else #else
/* Don't keep the reference to f_back any longer than necessary. It // Don't keep the reference to f_back any longer than necessary. It
* may keep a chain of frames alive or it could create a reference // may keep a chain of frames alive or it could create a reference
* cycle. */ // cycle.
if (self->exc_traceback) { if (self->exc_traceback) {
PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback; PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
PyFrameObject *f = tb->tb_frame; PyFrameObject *f = tb->tb_frame;
...@@ -261,7 +261,7 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) { ...@@ -261,7 +261,7 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
PyObject *ret; PyObject *ret;
// FIXME: does this really need an INCREF() ? // FIXME: does this really need an INCREF() ?
//Py_INCREF(yf); //Py_INCREF(yf);
/* YieldFrom code ensures that yf is an iterator */ // YieldFrom code ensures that yf is an iterator
gen->is_running = 1; gen->is_running = 1;
ret = Py_TYPE(yf)->tp_iternext(yf); ret = Py_TYPE(yf)->tp_iternext(yf);
gen->is_running = 0; gen->is_running = 0;
...@@ -364,7 +364,8 @@ static PyObject *__Pyx_Generator_Close(PyObject *self) { ...@@ -364,7 +364,8 @@ static PyObject *__Pyx_Generator_Close(PyObject *self) {
|| PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit) || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
|| PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration)) || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
{ {
if (raised_exception) PyErr_Clear(); /* ignore these errors */ // ignore these errors
if (raised_exception) PyErr_Clear();
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
...@@ -460,7 +461,7 @@ static void __Pyx_Generator_dealloc(PyObject *self) { ...@@ -460,7 +461,7 @@ static void __Pyx_Generator_dealloc(PyObject *self) {
PyObject_ClearWeakRefs(self); PyObject_ClearWeakRefs(self);
if (gen->resume_label > 0) { if (gen->resume_label > 0) {
/* Generator is paused, so we need to close */ // Generator is paused, so we need to close
PyObject_GC_Track(self); PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 #if PY_VERSION_HEX >= 0x030400a1
if (PyObject_CallFinalizerFromDealloc(self)) if (PyObject_CallFinalizerFromDealloc(self))
...@@ -468,7 +469,10 @@ static void __Pyx_Generator_dealloc(PyObject *self) { ...@@ -468,7 +469,10 @@ static void __Pyx_Generator_dealloc(PyObject *self) {
Py_TYPE(gen)->tp_del(self); Py_TYPE(gen)->tp_del(self);
if (self->ob_refcnt > 0) if (self->ob_refcnt > 0)
#endif #endif
return; /* resurrected. :( */ {
// resurrected. :(
return;
}
PyObject_GC_UnTrack(self); PyObject_GC_UnTrack(self);
} }
...@@ -485,12 +489,12 @@ static void __Pyx_Generator_del(PyObject *self) { ...@@ -485,12 +489,12 @@ static void __Pyx_Generator_del(PyObject *self) {
return ; return ;
#if PY_VERSION_HEX < 0x030400a1 #if PY_VERSION_HEX < 0x030400a1
/* Temporarily resurrect the object. */ // Temporarily resurrect the object.
assert(self->ob_refcnt == 0); assert(self->ob_refcnt == 0);
self->ob_refcnt = 1; self->ob_refcnt = 1;
#endif #endif
/* Save the current exception, if any. */ // Save the current exception, if any.
__Pyx_ErrFetch(&error_type, &error_value, &error_traceback); __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
res = __Pyx_Generator_Close(self); res = __Pyx_Generator_Close(self);
...@@ -500,20 +504,20 @@ static void __Pyx_Generator_del(PyObject *self) { ...@@ -500,20 +504,20 @@ static void __Pyx_Generator_del(PyObject *self) {
else else
Py_DECREF(res); Py_DECREF(res);
/* Restore the saved exception. */ // Restore the saved exception.
__Pyx_ErrRestore(error_type, error_value, error_traceback); __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1 #if PY_VERSION_HEX < 0x030400a1
/* Undo the temporary resurrection; can't use DECREF here, it would // Undo the temporary resurrection; can't use DECREF here, it would
* cause a recursive call. // cause a recursive call.
*/
assert(self->ob_refcnt > 0); assert(self->ob_refcnt > 0);
if (--self->ob_refcnt == 0) if (--self->ob_refcnt == 0) {
return; /* this is the normal path out */ // this is the normal path out
return;
}
/* close() resurrected it! Make it look like the original Py_DECREF // close() resurrected it! Make it look like the original Py_DECREF
* never happened. // never happened.
*/
{ {
Py_ssize_t refcnt = self->ob_refcnt; Py_ssize_t refcnt = self->ob_refcnt;
_Py_NewReference(self); _Py_NewReference(self);
...@@ -523,16 +527,15 @@ static void __Pyx_Generator_del(PyObject *self) { ...@@ -523,16 +527,15 @@ static void __Pyx_Generator_del(PyObject *self) {
assert(PyType_IS_GC(self->ob_type) && assert(PyType_IS_GC(self->ob_type) &&
_Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
/* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so // If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
* we need to undo that. */ // we need to undo that.
_Py_DEC_REFTOTAL; _Py_DEC_REFTOTAL;
#endif #endif
/* If Py_TRACE_REFS, _Py_NewReference re-added self to the object // If Py_TRACE_REFS, _Py_NewReference re-added self to the object
* chain, so no more to do there. // chain, so no more to do there.
* If COUNT_ALLOCS, the original decref bumped tp_frees, and // If COUNT_ALLOCS, the original decref bumped tp_frees, and
* _Py_NewReference bumped tp_allocs: both of those need to be // _Py_NewReference bumped tp_allocs: both of those need to be
* undone. // undone.
*/
#ifdef COUNT_ALLOCS #ifdef COUNT_ALLOCS
--Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_frees;
--Py_TYPE(self)->tp_allocs; --Py_TYPE(self)->tp_allocs;
...@@ -640,12 +643,12 @@ static PyTypeObject __pyx_GeneratorType_type = { ...@@ -640,12 +643,12 @@ static PyTypeObject __pyx_GeneratorType_type = {
0, /*tp_getattro*/ 0, /*tp_getattro*/
0, /*tp_setattro*/ 0, /*tp_setattro*/
0, /*tp_as_buffer*/ 0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
0, /*tp_doc*/ 0, /*tp_doc*/
(traverseproc) __Pyx_Generator_traverse, /*tp_traverse*/ (traverseproc) __Pyx_Generator_traverse, /*tp_traverse*/
0, /*tp_clear*/ 0, /*tp_clear*/
0, /*tp_richcompare*/ 0, /*tp_richcompare*/
offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffset */ offsetof(__pyx_GeneratorObject, gi_weakreflist), /*tp_weaklistoffset*/
0, /*tp_iter*/ 0, /*tp_iter*/
(iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/ (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
__pyx_Generator_methods, /*tp_methods*/ __pyx_Generator_methods, /*tp_methods*/
...@@ -706,7 +709,7 @@ static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body, ...@@ -706,7 +709,7 @@ static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
} }
static int __pyx_Generator_init(void) { static int __pyx_Generator_init(void) {
/* on Windows, C-API functions can't be used in slots statically */ // on Windows, C-API functions can't be used in slots statically
__pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
__pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment