Message169408
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). |
|
Date |
User |
Action |
Args |
2012-08-29 18:59:10 | loewis | set | recipients:
+ loewis, georg.brandl, mark.dickinson, ncoghlan, pitrou, vstinner, christian.heimes, Arfrever, skrah, meador.inge |
2012-08-29 18:59:10 | loewis | link | issue15814 messages |
2012-08-29 18:59:09 | loewis | create | |
|