summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-09-02 12:50:56 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-09-02 12:50:56 (GMT)
commit9c8ad0737a4fbacfdb324c01d28dc29b81599b15 (patch)
tree1af565296c6d433f847fe8c0aea845563f1d3e3a /Doc
parent02f66cbe8715db68167e61961c1bbba3f9cd22c1 (diff)
downloadcpython-9c8ad0737a4fbacfdb324c01d28dc29b81599b15.zip
cpython-9c8ad0737a4fbacfdb324c01d28dc29b81599b15.tar.gz
cpython-9c8ad0737a4fbacfdb324c01d28dc29b81599b15.tar.bz2
Issue #15814: Documentation: disallow hashing of multi-dimensional memoryviews.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/stdtypes.rst14
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 23d7fe1..90f3e54 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2376,8 +2376,9 @@ copying.
>>> data
bytearray(b'z1spam')
- Memoryviews of hashable (read-only) types with formats 'B', 'b' or 'c'
- are also hashable. The hash is defined as ``hash(m) == hash(m.tobytes())``::
+ One-dimensional memoryviews of hashable (read-only) types with formats
+ 'B', 'b' or 'c' are also hashable. The hash is defined as
+ ``hash(m) == hash(m.tobytes())``::
>>> v = memoryview(b'abcefg')
>>> hash(v) == hash(b'abcefg')
@@ -2388,12 +2389,13 @@ copying.
True
.. versionchanged:: 3.3
- Memoryview objects with formats 'B', 'b' or 'c' are now hashable.
+ One-dimensional memoryviews with formats 'B', 'b' or 'c' are now hashable.
.. note::
- Hashing of memoryviews with formats other than 'B', 'b' or 'c' is
- possible in version 3.3.0, but will raise an error in 3.3.1 in order
- to be compatible with the new memoryview equality definition.
+ Hashing of memoryviews with formats other than 'B', 'b' or 'c' as well
+ as hashing of multi-dimensional memoryviews is possible in version 3.3.0,
+ but will raise an error in 3.3.1 in order to be compatible with the new
+ memoryview equality definition.
:class:`memoryview` has several methods: