On Thu, Jul 4, 2013 at 9:12 AM, sebastian wrote:
> On 2013-07-04 15:06, Thomas Robitaille wrote:
> > Hi everyone,
> >
> > The following example:
> >
> > import numpy as np
> >
> > class SimpleArray(np.ndarray):
> >
> > __array_priority__ = 1
> >
> > def __new__(cls, inp
On 2013-07-04 15:06, Thomas Robitaille wrote:
> Hi everyone,
>
> The following example:
>
> import numpy as np
>
> class SimpleArray(np.ndarray):
>
> __array_priority__ = 1
>
> def __new__(cls, input_array, info=None):
> return np.asarray(input_array).vi
Hi,
__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.
So this will work with the next release of numpy.
I don't know of a workaround until the next release.
Fred
On Thu, Jul 4, 2013 a
Hi everyone,
The following example:
import numpy as np
class SimpleArray(np.ndarray):
__array_priority__ = 1
def __new__(cls, input_array, info=None):
return np.asarray(input_array).view(cls)
def __eq__(self, other):
return False