@@ -814,24 +814,10 @@ static PyMemberDef gen_memberlist[] = {
814814 {NULL } /* Sentinel */
815815};
816816
817- static PyObject *
818- gen_sizeof (PyGenObject * gen , PyObject * Py_UNUSED (ignored ))
819- {
820- Py_ssize_t res ;
821- res = offsetof(PyGenObject , gi_iframe ) + offsetof(_PyInterpreterFrame , localsplus );
822- PyCodeObject * code = _PyGen_GetCode (gen );
823- res += _PyFrame_NumSlotsForCodeObject (code ) * sizeof (PyObject * );
824- return PyLong_FromSsize_t (res );
825- }
826-
827- PyDoc_STRVAR (sizeof__doc__ ,
828- "gen.__sizeof__() -> size of gen in memory, in bytes" );
829-
830817static PyMethodDef gen_methods [] = {
831818 {"send" , gen_send , METH_O , send_doc },
832819 {"throw" , _PyCFunction_CAST (gen_throw ), METH_FASTCALL , throw_doc },
833820 {"close" , gen_close , METH_NOARGS , close_doc },
834- {"__sizeof__" , (PyCFunction )gen_sizeof , METH_NOARGS , sizeof__doc__ },
835821 {"__class_getitem__" , Py_GenericAlias , METH_O |METH_CLASS , PyDoc_STR ("See PEP 585" )},
836822 {NULL , NULL } /* Sentinel */
837823};
@@ -1192,7 +1178,6 @@ static PyMethodDef coro_methods[] = {
11921178 {"send" , gen_send , METH_O , coro_send_doc },
11931179 {"throw" ,_PyCFunction_CAST (gen_throw ), METH_FASTCALL , coro_throw_doc },
11941180 {"close" , gen_close , METH_NOARGS , coro_close_doc },
1195- {"__sizeof__" , (PyCFunction )gen_sizeof , METH_NOARGS , sizeof__doc__ },
11961181 {"__class_getitem__" , Py_GenericAlias , METH_O |METH_CLASS , PyDoc_STR ("See PEP 585" )},
11971182 {NULL , NULL } /* Sentinel */
11981183};
@@ -1620,7 +1605,6 @@ static PyMethodDef async_gen_methods[] = {
16201605 {"asend" , (PyCFunction )async_gen_asend , METH_O , async_asend_doc },
16211606 {"athrow" ,(PyCFunction )async_gen_athrow , METH_VARARGS , async_athrow_doc },
16221607 {"aclose" , (PyCFunction )async_gen_aclose , METH_NOARGS , async_aclose_doc },
1623- {"__sizeof__" , (PyCFunction )gen_sizeof , METH_NOARGS , sizeof__doc__ },
16241608 {"__class_getitem__" , Py_GenericAlias ,
16251609 METH_O |METH_CLASS , PyDoc_STR ("See PEP 585" )},
16261610 {NULL , NULL } /* Sentinel */
0 commit comments