|
From: Greg E. <gre...@ca...> - 2005-08-12 05:07:11
|
Seb...@el... wrote: > __wrap_array__(self, ufunc): # all unary operators like __neg__, __abs__, __invert__ > __lwrap_array__(self, other, ufunc): # all binary operators called with self on the lhs like __add__, __mul__, __pow__ > __rwrap_array__(self, other, ufunc): # all binary operators called with self on the rhs like __radd__, __rmul__, __rpow__ The term "wrap_array" doesn't seem very descriptive of what these are for. Wrapping of arrays may come into the implementations of them, but it's not the main point. The point is to apply a ufunc to the object and get an appropriate result. Maybe just __ufunc__, __lufunc__, __rufunc__? -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | gre...@ca... +--------------------------------------+ |