This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients Arfrever, christian.heimes, georg.brandl, loewis, mark.dickinson, meador.inge, ncoghlan, pitrou, skrah, vstinner
Date 2012-08-29.20:50:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <503E809D.4010108@v.loewis.de>
In-reply-to <20120829200409.GA5001@sleipnir.bytereef.org>
Content
Am 29.08.12 22:04, schrieb Stefan Krah:
> In the memoryview-hash thread on python-dev [1] this objection was
> addressed by demanding from exporters that they all use:
>
>     hash(x) == hash(x.tobytes())
>
> Since the previous equality concept was also based on
> x.tobytes() == y.tobytes(), this wasn't a problem.

In the light of this requirement, it's even more difficult to ask
people that they change their hashing, since some exporters may already
comply with that original request.

> The new equality definition and any possible new hash definition should
> probably also be part of the buffer API documentation, since they
> aren't memoryview specific.

That's not true: they *are* memoryview-specific. The notion of equality
is entirely one of memoryview objects, not of buffers.

I still maintain that specifying hashing for memoryviews under the
new equality definition is just not feasible, and that we should give
up on it (except perhaps supporting the hashing of bytes views).
I also question whether it is useful to hash arbitrarily-shaped
read-only buffers (along with questioning whether people will actually
*have* arbitrarily-shaped read-only buffers).

Stefan: please do propose a semantics also along with proposing interfaces.
History
Date User Action Args
2012-08-29 20:50:40loewissetrecipients: + loewis, georg.brandl, mark.dickinson, ncoghlan, pitrou, vstinner, christian.heimes, Arfrever, skrah, meador.inge
2012-08-29 20:50:40loewislinkissue15814 messages
2012-08-29 20:50:39loewiscreate