Author skrah
Recipients Arfrever, christian.heimes, georg.brandl, loewis, mark.dickinson, meador.inge, ncoghlan, pitrou, python-dev, skrah, vstinner
Date 2012-08-29.07:36:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
We overlooked one thing. Since hashing is defined in terms of
tobytes(), the equality-hash invariant is now broken:

>>> from _testbuffer import ndarray
>>> x = ndarray([1,2,3], shape=[3], format='f')
>>> y = ndarray([1,2,3], shape=[3], format='B')
>>> a = memoryview(x)
>>> b = memoryview(y)
>>> a == b
>>> hash(a) == hash(b)

This is one problem with the new equality definition. It puts
"memoryview" firmly into array territory. I'm not saying that's
wrong, I even think it was the intention of the PEP authors to
have a zero copy "arrayview".

Both array.array and numpy.array sidestep the issue by not being

I don't really see a way around all this except doing slow
element-wise hashing.
Date User Action Args
2012-08-29 07:36:21skrahsetrecipients: + skrah, loewis, georg.brandl, mark.dickinson, ncoghlan, pitrou, vstinner, christian.heimes, Arfrever, meador.inge, python-dev
2012-08-29 07:36:21skrahsetmessageid: <>
2012-08-29 07:36:20skrahlinkissue15573 messages
2012-08-29 07:36:19skrahcreate