how to get bytes from bytearray without copying

Ian Kelly ian.g.kelly at
Mon Mar 3 01:55:48 CET 2014

On Sun, Mar 2, 2014 at 5:44 PM, Cameron Simpson <cs at> wrote:
> Have you considered subclassing memoryview and giving the subclass
> a __hash__ method?

>>> class MyMemoryView(memoryview):
...     def __hash__(self): return 42
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type 'memoryview' is not an acceptable base type

More information about the Python-list mailing list