On 02Mar2014 17:55, Ian Kelly <ian.g.ke...@gmail.com> wrote: > On Sun, Mar 2, 2014 at 5:44 PM, Cameron Simpson <c...@zip.com.au> 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
Ah. The slices were going to be an issue too, anyway. He could write a wrapper class with a __hash__ method, whose slices themselves are also the wrapper class. It raises the implementation bar only slightly. Cheers, -- Cameron Simpson <c...@zip.com.au> Please do not send me Microsoft Word files. http://en.nothingisreal.com/wiki/Please_don't_send_me_Microsoft_Word_documents -- https://mail.python.org/mailman/listinfo/python-list