[Python-Dev] Hashable memoryviews

"Martin v. Löwis" martin at v.loewis.de
Sun Nov 13 21:34:06 CET 2011

> You can't expect the memoryview() to magically know what the underlying
> hash function is. 

Hashable objects implementing the buffer interface could be required to
make their hash implementation consistent with bytes hashing. IMO, that
wouldn't be asking too much.

There is already the issue that equality may not be transitive wrt. to
buffer objects (e.g. a == memoryview(a) == memoryview(b) == b, but a !=
b). As that would be a bug in either a or b, failure to hash
consistently would be a bug as well.


More information about the Python-Dev mailing list