Message167981
Nick: I still disagree. Would you agree that array.array constitutes a "statically typed array"? Yet
py> array.array('b',b'foo') == array.array('B',b'foo')
True
py> array.array('i',[1,2,3]) == array.array('L', [1,2,3])
True
So the array object (rightfully) performs comparison on abstract values, not on memory representation. In Python, a statically typed array still conceptually contains abstract values, not memory blocks (this is also what Stefan asserts for NumPy in msg167862). The static typing only restricts the values you can store in the container, and defines the internal representation on the C level (plus it typically implies a value storage, instead of a reference storage).
With your and Stefan's proposed semantics, we would get the weird case that for two array.arrays a and b, it might happen that
a == b and memoryview(a) != memoryview(b) |
|
Date |
User |
Action |
Args |
2012-08-11 17:31:05 | loewis | set | recipients:
+ loewis, georg.brandl, mark.dickinson, ncoghlan, pitrou, vstinner, christian.heimes, Arfrever, skrah, meador.inge, python-dev |
2012-08-11 17:31:04 | loewis | set | messageid: <1344706264.81.0.317722985041.issue15573@psf.upfronthosting.co.za> |
2012-08-11 17:31:04 | loewis | link | issue15573 messages |
2012-08-11 17:31:03 | loewis | create | |
|