[Python-Dev] Hashable memoryviews (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Sun Nov 13 01:23:59 CET 2011
- Previous message: [Python-Dev] documenting the Hg commit message hooks in the devguide
- Next message: [Python-Dev] Hashable memoryviews
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello everyone and Benjamin,
Currently, memoryview objects are unhashable:
hash(memoryview(b"")) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'memoryview'
Compare with Python 2.7:
hash(buffer("")) 0
memoryviews already support equality comparison:
b"" == memoryview(b"") True
If the original object providing the buffer is hashable, then it seems to make sense for the memoryview object to be hashable. This came while porting Twisted to Python 3.
What do you think?
Regards
Antoine.
- Previous message: [Python-Dev] documenting the Hg commit message hooks in the devguide
- Next message: [Python-Dev] Hashable memoryviews
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]