diff options
author | Georg Brandl <georg@python.org> | 2007-11-02 20:06:17 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-11-02 20:06:17 (GMT) |
commit | 7c3e79f67f6191fb500144db1d484d8bb8619f5a (patch) | |
tree | 36ae7c99ee5a7d66b8145f9005237e5897aae2d3 /Doc/library/weakref.rst | |
parent | 03fd077482fd5d88a40a8f0d04e0566b9738098a (diff) | |
download | cpython-7c3e79f67f6191fb500144db1d484d8bb8619f5a.zip cpython-7c3e79f67f6191fb500144db1d484d8bb8619f5a.tar.gz cpython-7c3e79f67f6191fb500144db1d484d8bb8619f5a.tar.bz2 |
Make "hashable" a glossary entry and clarify docs on __cmp__, __eq__ and __hash__.
I hope the concept of hashability is better understandable now.
Thanks to Tim Hatch for pointing out the flaws here.
Diffstat (limited to 'Doc/library/weakref.rst')
-rw-r--r-- | Doc/library/weakref.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst index 21007d9..225991a 100644 --- a/Doc/library/weakref.rst +++ b/Doc/library/weakref.rst @@ -87,7 +87,7 @@ Extension types can easily be made to support weak references; see but cannot be propagated; they are handled in exactly the same way as exceptions raised from an object's :meth:`__del__` method. - Weak references are hashable if the *object* is hashable. They will maintain + Weak references are :term:`hashable` if the *object* is hashable. They will maintain their hash value even after the *object* was deleted. If :func:`hash` is called the first time only after the *object* was deleted, the call will raise :exc:`TypeError`. @@ -108,7 +108,7 @@ Extension types can easily be made to support weak references; see the proxy in most contexts instead of requiring the explicit dereferencing used with weak reference objects. The returned object will have a type of either ``ProxyType`` or ``CallableProxyType``, depending on whether *object* is - callable. Proxy objects are not hashable regardless of the referent; this + callable. Proxy objects are not :term:`hashable` regardless of the referent; this avoids a number of problems related to their fundamentally mutable nature, and prevent their use as dictionary keys. *callback* is the same as the parameter of the same name to the :func:`ref` function. |