Martin v. Löwis added the comment:

I find Stefan's proposed equality confusing. Why is it based on memcmp? Either 
it compares memory (i.e. internal representations), or it compares abstract 
values. If it compares abstract values, then it shouldn't be a requirement that 
the format strings are equal in any sense. Instead, the resulting values should 
be equal. So I propose this definition:

v == w iff v.shape() == w.shape() and v.tolist() == w.tolist()
if either operation fails with an exception, the objects are not equal

Of course, the implementation doesn't need to literally call tolist; instead, 
behaving as-if it had been called is fine. However, as time
is running out, I would actually propose this to be the implementation
in 3.3.

In addition, I would propose to support the 'u' and 'w' codes in tolist, to 
resolve what Victor says the actual issue is.

I'm -1 on a definition that involves equivalence of format strings.

----------

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

Reply via email to