Message168028
Martin v. L??wis <report@bugs.python.org> wrote:
> Here is a more formal definition of my last proposal,
>
> v and w are equal iff
> v.shape() == w.shape() and
> ((v.format == w.format and v.tobytes() == w.tobytes()) or
> v.tolist() == w.tolist())
> if tolist raises an exception for unsupported codes, they are not equal
This wouldn't solve the NaN problem though:
>>> nd = ndarray([(1,2)], shape=[1], format='dd', flags=ND_WRITABLE)
>>> nd[0] = (float('nan'), float('nan'))
>>> m = memoryview(nd)
>>> m == nd
True
What's the policy on importing modules in the Object/* hierarchy? Can we
import _struct?
The current unpack_cmp() function for identical single native format codes
is very fast. The only thing that would be needed to make it general is
to replace
default: return -1;
with
default: return unpack_cmp_struct();
The code is already there in _testbuffer.c. _testbuffer.c itself has 100%
code coverage (including all error conditions with a special patch).
This means that all tests are already present in test_buffer.py. |
|
Date |
User |
Action |
Args |
2012-08-12 09:37:43 | skrah | set | recipients:
+ skrah, loewis, georg.brandl, mark.dickinson, ncoghlan, pitrou, vstinner, christian.heimes, Arfrever, meador.inge, python-dev |
2012-08-12 09:37:43 | skrah | link | issue15573 messages |
2012-08-12 09:37:42 | skrah | create | |
|