[issue15573] Support unknown formats in memoryview comparisons

Martin v. Löwis report at bugs.python.org
Sat Aug 11 21:45:44 CEST 2012


Martin v. Löwis added the comment:

> And, to be honest, I'd be quite happy for "congratulations, you have
> reached the threshold where you need NumPy rather than memoryview" to
> be the long term answer to getting "by value" comparison semantics.

IMO, this threshold is already reached when you start comparing 
memoryview objects. PEP 3118 apparently introduced it to replace
the buffer obejct, and specified that it should have __getitem__
and __setitem__ as magic methods; the PEP doesn't talk about comparison
at all. So I wonder where the desire to support comparison for
equality comes from (but I can accept that we have to deal with it
as it is there now). IMO, it would be reasonable to declare to memory
buffers as unequal if they denote different memory blocks in main
memory (i.e. at different addresses).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15573>
_______________________________________


More information about the Python-bugs-list mailing list