[Python-Dev] Hashable memoryviews (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Sun Nov 13 21:34:06 CET 2011
- Previous message: [Python-Dev] Hashable memoryviews
- Next message: [Python-Dev] Hashable memoryviews
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
Regards, Martin
- Previous message: [Python-Dev] Hashable memoryviews
- Next message: [Python-Dev] Hashable memoryviews
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]