[Numpy-discussion] metadata and metabehavior for arrays (for scipy.base or Numeric3)

konrad.hinsen at laposte.net konrad.hinsen at laposte.net
Thu Apr 7 02:42:07 EDT 2005


On Apr 7, 2005, at 11:25, Sebastien.deMentendeHorne at electrabel.com 
wrote:

> Why not have the ability to ask the name of an ufunc to be able to 
> dispatch on it ?

That's already possible.

> What about :
>
> object.__unary__(cos, mode = "reduce")
> object.__binary__(cos, other, mode = "reduce")

What does "reduce" mode mean for cos?
What does a binary ufunc in reduce mode do with its second argument?

> However, for binary operations, how it the call dispatched if one of 
> the operand is of a type while the other is another type ? This 
> problem is related to multimethods 
> http://www.artima.com/weblogs/viewpost.jsp?thread=101605

No need to be innovative: Python always dispatches on the first 
argument, and everybody is familiar with that approach even though it 
isn't perfect. If Python 3000 has multimethods, we can still adapt.

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: khinsen at cea.fr
---------------------------------------------------------------------





More information about the NumPy-Discussion mailing list