[issue15814] memoryview: equality-hash invariant
report at bugs.python.org
Fri Aug 31 06:14:02 CEST 2012
Stefan Behnel added the comment:
To add on Dag's comments, this essentially means that any caching of the hash value is dangerous, unless it can be assured that the underlying buffer definitely has not changed in the meantime. There is no way for users to explicitly tell a memoryview to rehash itself, so putting it into one dict, then modifying the content, then putting it into another is a perfectly reasonable use case for users, but fails when the memory view caches its hash value.
As far as I can see it, any "obvious" fix for this creates a whole bath tub full of worms: updating views transitively, adding new APIs, supporting new buffer parameters, ...
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list