diff options
author | Guido van Rossum <guido@python.org> | 2006-08-17 05:42:55 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-08-17 05:42:55 (GMT) |
commit | 50e9fb9e2d6b4b12524116ab775ac6543e4a5332 (patch) | |
tree | 96f41e9a6d07a2754fcaceb7b54a7c11f112687f /Python | |
parent | d033ddf4dc501e0920adec9e193750e515bbd128 (diff) | |
download | cpython-50e9fb9e2d6b4b12524116ab775ac6543e4a5332.zip cpython-50e9fb9e2d6b4b12524116ab775ac6543e4a5332.tar.gz cpython-50e9fb9e2d6b4b12524116ab775ac6543e4a5332.tar.bz2 |
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.)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 15 | ||||
-rw-r--r-- | Python/structmember.c | 4 |
2 files changed, 6 insertions, 13 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 9a9b98e..07dfdc2 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 diff --git a/Python/structmember.c b/Python/structmember.c index 54eb055..688a4b8 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -126,6 +126,10 @@ PyMember_GetOne(const char *addr, PyMemberDef *l) v = PyLong_FromUnsignedLongLong(*(unsigned PY_LONG_LONG *)addr); break; #endif /* HAVE_LONG_LONG */ + case T_NONE: + v = Py_None; + Py_INCREF(v); + break; default: PyErr_SetString(PyExc_SystemError, "bad memberdescr type"); v = NULL; |