This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients Arfrever, christian.heimes, georg.brandl, loewis, mark.dickinson, meador.inge, ncoghlan, pitrou, python-dev, skrah, vstinner
Date 2012-08-11.17:31:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344706264.81.0.317722985041.issue15573@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2012-08-11 17:31:05loewissetrecipients: + loewis, georg.brandl, mark.dickinson, ncoghlan, pitrou, vstinner, christian.heimes, Arfrever, skrah, meador.inge, python-dev
2012-08-11 17:31:04loewissetmessageid: <1344706264.81.0.317722985041.issue15573@psf.upfronthosting.co.za>
2012-08-11 17:31:04loewislinkissue15573 messages
2012-08-11 17:31:03loewiscreate