mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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:
parent
d033ddf4dc
commit
50e9fb9e2d
22 changed files with 325 additions and 2543 deletions
|
|
@ -2381,13 +2381,6 @@ list_init(PyListObject *self, PyObject *args, PyObject *kw)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static long
|
||||
list_nohash(PyObject *self)
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "list objects are unhashable");
|
||||
return -1;
|
||||
}
|
||||
|
||||
static PyObject *list_iter(PyObject *seq);
|
||||
static PyObject *list_reversed(PyListObject* seq, PyObject* unused);
|
||||
|
||||
|
|
@ -2655,7 +2648,7 @@ PyTypeObject PyList_Type = {
|
|||
0, /* tp_as_number */
|
||||
&list_as_sequence, /* tp_as_sequence */
|
||||
&list_as_mapping, /* tp_as_mapping */
|
||||
list_nohash, /* tp_hash */
|
||||
0, /* tp_hash */
|
||||
0, /* tp_call */
|
||||
0, /* tp_str */
|
||||
PyObject_GenericGetAttr, /* tp_getattro */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue