[Numpy-discussion] ndarray special methods should raise NotImplemented instead of TypeError

2011-03-13 Thread Hoyt Koepke
Apologies for cross posting -- I posted this to the scipy developer list a few days ago, since it's really a development question, but after getting no response I reread my question and realized it was a bit unclear and also was more appropriate for numpy. So here goes. Currently, the numerical

Re: [Numpy-discussion] ndarray special methods should raise NotImplemented instead of TypeError

2011-03-13 Thread Charles R Harris
On Sun, Mar 13, 2011 at 3:24 PM, Hoyt Koepke hoy...@stat.washington.eduwrote: Apologies for cross posting -- I posted this to the scipy developer list a few days ago, since it's really a development question, but after getting no response I reread my question and realized it was a bit unclear

Re: [Numpy-discussion] ndarray special methods should raise NotImplemented instead of TypeError

2011-03-13 Thread Hoyt Koepke
You can also define __array_priority__  in your class. If your class isn't a subclass, then numpy will always call your class methods whether or not your class is on the right or left. Sounds like you don't want to sublass ndarray here so that should work. Excellent! This sounds like exactly

Re: [Numpy-discussion] ndarray special methods should raise NotImplemented instead of TypeError

2011-03-13 Thread Charles R Harris
On Sun, Mar 13, 2011 at 3:53 PM, Hoyt Koepke hoy...@stat.washington.eduwrote: You can also define __array_priority__ in your class. If your class isn't a subclass, then numpy will always call your class methods whether or not your class is on the right or left. Sounds like you don't want