Backport of _abccoll.py by Benjamin Arangueren, issue 1383.

With some changes of my own thrown in (e.g. backport of r58107).
This commit is contained in:
Guido van Rossum 2007-11-22 00:55:51 +00:00
parent cc7f26bf20
commit 64c06e327d
13 changed files with 822 additions and 51 deletions

View file

@ -789,13 +789,6 @@ frozenset_hash(PyObject *self)
return hash;
}
static long
set_nohash(PyObject *self)
{
PyErr_SetString(PyExc_TypeError, "set objects are unhashable");
return -1;
}
/***** Set iterator type ***********************************************/
typedef struct {
@ -2012,7 +2005,7 @@ PyTypeObject PySet_Type = {
&set_as_number, /* tp_as_number */
&set_as_sequence, /* tp_as_sequence */
0, /* tp_as_mapping */
set_nohash, /* tp_hash */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */