|
From: Travis O. <oli...@ee...> - 2005-08-10 17:01:19
|
Seb...@el... wrote: >Hi, > >Currently, we have an __array__ magic method that can be used to transform any object that implements it into an array. >It think that a more useful magic method would be, for ufuncs, a __wrap_array__ method that would return an array object and a function to use after having applied the ufunc. > > There is an interest in doing this but it is a bit more complicated for ufuncs with more than one input argument and more than one output argument. I have not seen a proposal that really works. Your __wrap_array__ method sounds interesting though. I think, however, that the __wrap_array__ method would need to provide some kind of array_interfaceable object to be really useful. In the new scipy.base, I've been trying to handle some of this, but it is more complicated than it might at first appear. -Travis |