On Tue, Feb 18, 2014 at 11:19 AM, Sturla Molden <sturla.mol...@gmail.com> wrote: > Robert Kern <robert.k...@gmail.com> wrote: > >> That's fine if you only have one value for each operand. When you have >> multiple values for each operand, say an exponent array containing >> both positive and negative integers, that becomes a problem. > > I don't really see why. If you have a negative integer in there you get a > float array returned, otherwise it stays integer.
We don't do this for any other ufunc. >> Generally, we try to make ufuncs return types that are predictable >> from the types of the operands, not the values of the operands. > > Isn't that unpractical in this case? Who cares if the power operator > behaves as an ufunc? We're talking about numpy.power(), not just ndarray.__pow__(). The equivalence of the two is indeed an implementation detail, but I do think that it is useful to maintain the equivalence. If we didn't, it would be the only exception, to my knowledge. -- Robert Kern _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion