]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-37051: Refine note on what objects are hashable (GH-13587) (GH-13595)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 27 May 2019 17:43:18 +0000 (10:43 -0700)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>
Mon, 27 May 2019 17:43:18 +0000 (10:43 -0700)
(cherry picked from commit cc1c582f6fe450ce1c7de849137039e9b5fab8eb)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Doc/glossary.rst

index b6ab28617d142d00b68f1882c80a478c936e54c7..f7f35cbb67d288f312fb4dce1de35dd2178c5bb4 100644 (file)
@@ -508,8 +508,10 @@ Glossary
       Hashability makes an object usable as a dictionary key and a set member,
       because these data structures use the hash value internally.
 
-      All of Python's immutable built-in objects are hashable; mutable
-      containers (such as lists or dictionaries) are not.  Objects which are
+      Most of Python's immutable built-in objects are hashable; mutable
+      containers (such as lists or dictionaries) are not; immutable
+      containers (such as tuples and frozensets) are only hashable if
+      their elements are hashable.  Objects which are
       instances of user-defined classes are hashable by default.  They all
       compare unequal (except with themselves), and their hash value is derived
       from their :func:`id`.