From 50e9fb9e2d6b4b12524116ab775ac6543e4a5332 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 17 Aug 2006 05:42:55 +0000 Subject: Completely get rid of PyClass and PyInstance. (classobject.[ch] aren't empty yet because they also define PyMethod.) This breaks lots of stuff, notably cPickle. But it's a step in the right direction. I'll clean it up later. (Also a few unrelated changes, e.g. T_NONE to define a "struct member" that is always None, and simplification of __hash__ -- these are unfinished.) --- Python/ceval.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'Python/ceval.c') diff --git a/Python/ceval.c b/Python/ceval.c index 9a9b98eb47..07dfdc20a6 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3409,14 +3409,8 @@ PyEval_GetFuncName(PyObject *func) return PyString_AsString(((PyFunctionObject*)func)->func_name); else if (PyCFunction_Check(func)) return ((PyCFunctionObject*)func)->m_ml->ml_name; - else if (PyClass_Check(func)) - return PyString_AsString(((PyClassObject*)func)->cl_name); - else if (PyInstance_Check(func)) { - return PyString_AsString( - ((PyInstanceObject*)func)->in_class->cl_name); - } else { + else return func->ob_type->tp_name; - } } const char * @@ -3428,13 +3422,8 @@ PyEval_GetFuncDesc(PyObject *func) return "()"; else if (PyCFunction_Check(func)) return "()"; - else if (PyClass_Check(func)) - return " constructor"; - else if (PyInstance_Check(func)) { - return " instance"; - } else { + else return " object"; - } } static void -- cgit v1.2.1