lou1306 added the comment:

I noticed the issue is still there in Python 3.6.
But I can't see why array subclasses should be the reason for this 
implementation.
By looking at getarrayitem, it looks like __getitem__ does not play any role in 
how the elements are accessed.
Consider the attached example, where SubclassedArray.__getitem__ is overridden 
to always return 0: nonetheless, equality checks with an array.array containing 
the same elements always succeed.

> For cases where the signedness and element size are identical, it's trivial 
> to acquire readonly buffers for both arrays and directly compare the memory

I would argue that _integerness_ sholud also be identical: otherwise
array("l", range(10)) == array("f", range(10))
would evaluate to False, while it is True in the current implementation.

----------
nosy: +Luca Di Stefano
Added file: http://bugs.python.org/file46675/subclass_test.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24700>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to