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.)
This commit is contained in:
Guido van Rossum 2006-08-17 05:42:55 +00:00
parent d033ddf4dc
commit 50e9fb9e2d
22 changed files with 325 additions and 2543 deletions

View file

@ -379,13 +379,6 @@ bytes_setitem(PyBytesObject *self, Py_ssize_t i, PyObject *value)
return 0;
}
static long
bytes_nohash(PyObject *self)
{
PyErr_SetString(PyExc_TypeError, "bytes objects are unhashable");
return -1;
}
static int
bytes_init(PyBytesObject *self, PyObject *args, PyObject *kwds)
{
@ -833,7 +826,7 @@ PyTypeObject PyBytes_Type = {
0, /* tp_as_number */
&bytes_as_sequence, /* tp_as_sequence */
&bytes_as_mapping, /* tp_as_mapping */
bytes_nohash, /* tp_hash */
0, /* tp_hash */
0, /* tp_call */
(reprfunc)bytes_str, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */