Message169415
| Author |
skrah |
| Recipients |
Arfrever, christian.heimes, georg.brandl, loewis, mark.dickinson, meador.inge, ncoghlan, pitrou, skrah, vstinner |
| Date |
2012年08月29日.20:04:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<20120829200409.GA5001@sleipnir.bytereef.org> |
| In-reply-to |
<503E6E97.3080101@v.loewis.de> |
| Content |
Martin v. L??wis <report@bugs.python.org> wrote:
> In general, since memoryview(obj)==obj, it would be necessary that
> hash(memoryview(obj))==hash(obj). However, since memoryview cannot
> know what hashing algorithm obj uses, it cannot compute the hash
> value with the same algorithm.
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.
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.
[1] http://mail.python.org/pipermail/python-dev/2011-November/114459.html |
|