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 skrah
Recipients Arfrever, belopolsky, christian.heimes, georg.brandl, loewis, mark.dickinson, meador.inge, ncoghlan, pitrou, skrah, vstinner
Date 2012-08-30.09:24:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20120830092448.GA10805@sleipnir.bytereef.org>
In-reply-to <503E809D.4010108@v.loewis.de>
Content
Martin v. L??wis <report@bugs.python.org> wrote:
> >     hash(x) == hash(x.tobytes())
> 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.

I don't think so. memoryview.__hash__() is new in 3.3 and the requirement
is not documented at all in the general PEP-3118 sections.

[Adding Stefan Behnel to nosy, since Cython is pretty quick to pick up
new features.]

> > 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.

Could you name a part of the equality definition that is memoryview-specific?

> 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).

Useful, perhaps. I don't know if it is worth the effort though. We
could restrict hashing to contiguous bytes views in 3.3.1.
History
Date User Action Args
2012-08-30 09:24:49skrahsetrecipients: + skrah, loewis, georg.brandl, mark.dickinson, ncoghlan, belopolsky, pitrou, vstinner, christian.heimes, Arfrever, meador.inge
2012-08-30 09:24:48skrahlinkissue15814 messages
2012-08-30 09:24:47skrahcreate