@@ -556,6 +556,12 @@ descr_traverse(PyObject *self, visitproc visit, void *arg)
556556 return 0 ;
557557}
558558
559+ #ifdef STACKLESS
560+ static PyMappingMethods descr_as_mapping = {
561+ .slpflags .tp_call = -1 ,
562+ };
563+ #endif
564+
559565PyTypeObject PyMethodDescr_Type = {
560566 PyVarObject_HEAD_INIT (& PyType_Type , 0 )
561567 "method_descriptor" ,
@@ -569,14 +575,15 @@ PyTypeObject PyMethodDescr_Type = {
569575 (reprfunc )method_repr , /* tp_repr */
570576 0 , /* tp_as_number */
571577 0 , /* tp_as_sequence */
572- 0 , /* tp_as_mapping */
578+ SLP_TP_AS_MAPPING ( descr_as_mapping ), /* tp_as_mapping */
573579 0 , /* tp_hash */
574580 (ternaryfunc )methoddescr_call , /* tp_call */
575581 0 , /* tp_str */
576582 PyObject_GenericGetAttr , /* tp_getattro */
577583 0 , /* tp_setattro */
578584 0 , /* tp_as_buffer */
579- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC , /* tp_flags */
585+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
586+ Py_TPFLAGS_HAVE_STACKLESS_EXTENSION , /* tp_flags */
580587 0 , /* tp_doc */
581588 descr_traverse , /* tp_traverse */
582589 0 , /* tp_clear */
@@ -593,7 +600,6 @@ PyTypeObject PyMethodDescr_Type = {
593600 0 , /* tp_descr_set */
594601};
595602
596- STACKLESS_DECLARE_METHOD (& PyMethodDescr_Type , tp_call )
597603
598604/* This is for METH_CLASS in C, not for "f = classmethod(f)" in Python! */
599605PyTypeObject PyClassMethodDescr_Type = {
@@ -609,14 +615,15 @@ PyTypeObject PyClassMethodDescr_Type = {
609615 (reprfunc )method_repr , /* tp_repr */
610616 0 , /* tp_as_number */
611617 0 , /* tp_as_sequence */
612- 0 , /* tp_as_mapping */
618+ SLP_TP_AS_MAPPING ( descr_as_mapping ), /* tp_as_mapping */
613619 0 , /* tp_hash */
614620 (ternaryfunc )classmethoddescr_call , /* tp_call */
615621 0 , /* tp_str */
616622 PyObject_GenericGetAttr , /* tp_getattro */
617623 0 , /* tp_setattro */
618624 0 , /* tp_as_buffer */
619- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC , /* tp_flags */
625+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
626+ Py_TPFLAGS_HAVE_STACKLESS_EXTENSION , /* tp_flags */
620627 0 , /* tp_doc */
621628 descr_traverse , /* tp_traverse */
622629 0 , /* tp_clear */
@@ -633,7 +640,6 @@ PyTypeObject PyClassMethodDescr_Type = {
633640 0 , /* tp_descr_set */
634641};
635642
636- STACKLESS_DECLARE_METHOD (& PyClassMethodDescr_Type , tp_call )
637643
638644PyTypeObject PyMemberDescr_Type = {
639645 PyVarObject_HEAD_INIT (& PyType_Type , 0 )
@@ -722,14 +728,15 @@ PyTypeObject PyWrapperDescr_Type = {
722728 (reprfunc )wrapperdescr_repr , /* tp_repr */
723729 0 , /* tp_as_number */
724730 0 , /* tp_as_sequence */
725- 0 , /* tp_as_mapping */
731+ SLP_TP_AS_MAPPING ( descr_as_mapping ), /* tp_as_mapping */
726732 0 , /* tp_hash */
727733 (ternaryfunc )wrapperdescr_call , /* tp_call */
728734 0 , /* tp_str */
729735 PyObject_GenericGetAttr , /* tp_getattro */
730736 0 , /* tp_setattro */
731737 0 , /* tp_as_buffer */
732- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC , /* tp_flags */
738+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
739+ Py_TPFLAGS_HAVE_STACKLESS_EXTENSION , /* tp_flags */
733740 0 , /* tp_doc */
734741 descr_traverse , /* tp_traverse */
735742 0 , /* tp_clear */
@@ -746,7 +753,6 @@ PyTypeObject PyWrapperDescr_Type = {
746753 0 , /* tp_descr_set */
747754};
748755
749- STACKLESS_DECLARE_METHOD (& PyWrapperDescr_Type , tp_call )
750756
751757static PyDescrObject *
752758descr_new (PyTypeObject * descrtype , PyTypeObject * type , const char * name )
@@ -1210,14 +1216,15 @@ PyTypeObject _PyMethodWrapper_Type = {
12101216 (reprfunc )wrapper_repr , /* tp_repr */
12111217 0 , /* tp_as_number */
12121218 0 , /* tp_as_sequence */
1213- 0 , /* tp_as_mapping */
1219+ SLP_TP_AS_MAPPING ( descr_as_mapping ), /* tp_as_mapping */
12141220 (hashfunc )wrapper_hash , /* tp_hash */
12151221 (ternaryfunc )wrapper_call , /* tp_call */
12161222 0 , /* tp_str */
12171223 PyObject_GenericGetAttr , /* tp_getattro */
12181224 0 , /* tp_setattro */
12191225 0 , /* tp_as_buffer */
1220- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC , /* tp_flags */
1226+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
1227+ Py_TPFLAGS_HAVE_STACKLESS_EXTENSION , /* tp_flags */
12211228 0 , /* tp_doc */
12221229 wrapper_traverse , /* tp_traverse */
12231230 0 , /* tp_clear */
@@ -1234,7 +1241,6 @@ PyTypeObject _PyMethodWrapper_Type = {
12341241 0 , /* tp_descr_set */
12351242};
12361243
1237- STACKLESS_DECLARE_METHOD (& _PyMethodWrapper_Type , tp_call )
12381244
12391245PyObject *
12401246PyWrapper_New (PyObject * d , PyObject * self )
0 commit comments