cpython/Objects
Guido van Rossum dbb53d9918 Fix of SF bug #475877 (Mutable subtype instances are hashable).
Rather than tweaking the inheritance of type object slots (which turns
out to be too messy to try), this fix adds a __hash__ to the list and
dict types (the only mutable types I'm aware of) that explicitly
raises an error.  This has the advantage that list.__hash__([]) also
raises an error (previously, this would invoke object.__hash__([]),
returning the argument's address); ditto for dict.__hash__.

The disadvantage for this fix is that 3rd party mutable types aren't
automatically fixed.  This should be added to the rules for creating
subclassable extension types: if you don't want your object to be
hashable, add a tp_hash function that raises an exception.

Also, it's possible that I've forgotten about other mutable types for
which this should be done.
2001-12-03 16:32:18 +00:00
..
.cvsignore Ignore a bunch of generated files. 2000-05-02 18:34:30 +00:00
abstract.c PyObject_GetItem(), PyObject_SetItem(), PyObject_DelItem(): Fix a few 2001-11-24 18:24:47 +00:00
bufferobject.c Fix for Bug #216405: 2001-10-19 13:49:35 +00:00
cellobject.c Use new GC API. 2001-08-29 23:54:21 +00:00
classobject.c Be smarter about clearing the weakref lists for instances, instance methods, 2001-10-26 17:56:51 +00:00
cobject.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
complexobject.c complex_to_buf(), complex_subtype_from_c_complex(): Conversion of 2001-11-28 20:50:56 +00:00
descrobject.c Methods of built-in types now properly check for keyword arguments 2001-10-22 00:43:43 +00:00
dictobject.c Fix of SF bug #475877 (Mutable subtype instances are hashable). 2001-12-03 16:32:18 +00:00
fileobject.c Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the 2001-11-30 14:16:36 +00:00
floatobject.c PyFloat_AsStringEx(): This function takes an output char* but doesn't 2001-11-28 22:43:45 +00:00
frameobject.c Add optional docstrings to getset descriptors. Fortunately, there's 2001-09-20 21:45:26 +00:00
funcobject.c Be smarter about clearing the weakref lists for instances, instance methods, 2001-10-26 17:56:51 +00:00
intobject.c SF bug #487743: test_builtin fails on 64 bit platform. 2001-12-01 02:52:56 +00:00
iterobject.c Patch #427190: Implement and use METH_NOARGS and METH_O. 2001-08-16 13:15:00 +00:00
listobject.c Fix of SF bug #475877 (Mutable subtype instances are hashable). 2001-12-03 16:32:18 +00:00
longobject.c long_true_divide(): decref its converted arguments. test_long_future.py 2001-11-04 23:09:40 +00:00
methodobject.c Add optional docstrings to getset descriptors. Fortunately, there's 2001-09-20 21:45:26 +00:00
moduleobject.c Add missing "static" declarations (found by "make smelly"). 2001-10-21 22:28:58 +00:00
object.c Rehabilitated the fast-path richcmp code, and sped it up. It wasn't 2001-11-04 07:29:31 +00:00
obmalloc.c Identifiers matching _[A-Z_]\w* are reserved for C implementations. 2001-03-11 18:36:13 +00:00
rangeobject.c repr's converted to using PyString_FromFormat() instead of sprintf'ing 2001-08-24 18:34:26 +00:00
sliceobject.c Add values to tp_getattro and tp_flags so that dir(Ellipsis) will 2001-10-30 02:40:52 +00:00
stringobject.c Add more inline documentation, as contributed in #487906. 2001-12-03 08:24:52 +00:00
structseq.c structseq_new(): Conversion of sprintf() to PyOS_snprintf() for buffer 2001-11-28 20:56:44 +00:00
tupleobject.c Enable GC for new-style instances. This touches lots of files, since 2001-10-05 20:51:39 +00:00
typeobject.c Address SF patch #480716 as well as related issues. 2001-12-03 15:38:28 +00:00
unicodectype.c removed "register const" from scalar arguments to the unicode 2001-06-27 22:08:26 +00:00
unicodeobject.c formatfloat(), formatint(): Conversion of sprintf() to PyOS_snprintf() 2001-11-28 21:00:41 +00:00
unicodetype_db.h forgot to check in the new makeunicodedata.py script 2001-01-21 17:01:31 +00:00
weakrefobject.c weakref_repr(), proxy_repr(): Conversion of sprintf() to 2001-11-28 21:01:56 +00:00
xxobject.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00