Message169408
| Author |
loewis |
| Recipients |
Arfrever, christian.heimes, georg.brandl, loewis, mark.dickinson, meador.inge, ncoghlan, pitrou, skrah, vstinner |
| Date |
2012年08月29日.18:59:09 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<503E667B.8070804@v.loewis.de> |
| In-reply-to |
<1346263077.3344.0.camel@localhost.localdomain> |
| Content |
Am 29.08.12 20:01, schrieb Antoine Pitrou:
>> I think the proper solution is to make memoryview objects unhashable.
>
> Disagreed. If memoryviews are to be bytes-like objects they should be
> hashable (at least when readonly).
So what specific hash algorithm do you propose?
>> Any other approach will have flaws of some kind.
>
> Not more so than equality between memoryviews.
Well, memoryviews now have a definition of equality as discussed in
issue15573. You may disagree whether it's a useful definition, but I
don't believe it has actual flaws (in the sense that it is incorrect
or inconsistent).
My claim is that any hash definition for memoryviews will have a
*fundamental* flaw, failing to provide the basic property
that A==B must imply hash(A)==hash(B), making it actually work
incorrectly (when used for its primary application, namely keys
in dictionaries). |
|