<div dir="ltr">Hi,<div><br></div><div style>__array__priority wasn't checked for ==, !=, <, <=, >, >= operation. I added it in the development version and someone else back-ported it to the 1.7.X branch.</div>

<div style><br></div><div style>So this will work with the next release of numpy.</div><div style><br></div><div style>I don't know of a workaround until the next release.</div><div style><br></div><div style>Fred</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 4, 2013 at 9:06 AM, Thomas Robitaille <span dir="ltr"><<a href="mailto:thomas.robitaille@gmail.com" target="_blank">thomas.robitaille@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone,<br>
<br>
The following example:<br>
<br>
    import numpy as np<br>
<br>
    class SimpleArray(np.ndarray):<br>
<br>
        __array_priority__ = 10000<br>
<br>
        def __new__(cls, input_array, info=None):<br>
            return np.asarray(input_array).view(cls)<br>
<br>
        def __eq__(self, other):<br>
            return False<br>
<br>
    a = SimpleArray(10)<br>
    print (np.int64(10) == a)<br>
    print (a == np.int64(10))<br>
<br>
gives the following output<br>
<br>
    $ python2.7 eq.py<br>
    True<br>
    False<br>
<br>
so that in the first case, SimpleArray.__eq__ is not called. Is this a<br>
bug, and if so, can anyone think of a workaround? If this is expected<br>
behavior, how do I ensure SimpleArray.__eq__ gets called in both<br>
cases?<br>
<br>
Thanks,<br>
Tom<br>
<br>
ps: cross-posting to stackoverflow<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div><br></div>