Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(88257)

Unified Diff: Doc/library/stdtypes.rst

Issue 13411: Hashable memoryviews
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Include/memoryobject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2401,6 +2401,19 @@ copying. Memory is generally interprete
Notice how the size of the memoryview object cannot be changed.
+ Memoryviews of hashable (read-only) types are also hashable and their
+ hash value matches the corresponding bytes object::
+
+ >>> v = memoryview(b'abcefg')
+ >>> hash(v) == hash(b'abcefg')
+ True
+ >>> hash(v[2:4]) == hash(b'ce')
+ True
+
+ .. versionchanged:: 3.3
+ Memoryview objects are now hashable.
+
+
:class:`memoryview` has several methods:
.. method:: tobytes()
« no previous file with comments | « no previous file | Include/memoryobject.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+