Message169440
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. |
|
Date |
User |
Action |
Args |
2012-08-30 09:24:49 | skrah | set | recipients:
+ skrah, loewis, georg.brandl, mark.dickinson, ncoghlan, belopolsky, pitrou, vstinner, christian.heimes, Arfrever, meador.inge |
2012-08-30 09:24:48 | skrah | link | issue15814 messages |
2012-08-30 09:24:47 | skrah | create | |
|