[issue15573] Support unknown formats in memoryview comparisons

Nick Coghlan report at bugs.python.org
Sat Aug 11 21:52:48 CEST 2012


Nick Coghlan added the comment:

Hmm, you're right. OK, here's a simpler proposal for 3.3:

1. Always look at shape first. If they're different, then they're not equal

2. If both formats are known, compare by unpacked value

3. If either format is unknown, compare by memory contents (just like 3.2)

The fallback case should then behave exactly like 3.2 (since 3.2 really couldn't handle anything other than 1D data and always ignored the format info).

I'd be happier if the compare-by-value didn't make complete copies of the entire array though.

----------

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


More information about the Python-bugs-list mailing list