[Numpy-discussion] Proposal for changing the names of inverse trigonometrical/hyperbolic functions
David Warde-Farley
dwf@cs.toronto....
Mon Nov 24 16:00:47 CST 2008
On 24-Nov-08, at 4:22 PM, Gabriel Gellner wrote:
>> asin(1j) raises an exception, arcsin doesn't. They are *different*
>> functions, hence the names.
>>
> Yet:
>
>>>> type(np.sin(1)) == type(math.sin(1))
> False
In fact, this goes for every single function listed in the math
module's docs, except for the somewhat useless pow(). *Every* other
function in math has a corresponding numpy ufunc with the exact same
name. So, no, I don't think that's a compelling argument either.
> And they have the same name. Isn't this what name spaces are for? I
> think it is
> strange that some of the math functions have the same name, and some
> don't. I
> can't see how being different functions justifies this, or we need
> to rename
> the normal trig functions.
>
> I can see not wanting to break API compatibility but I don't find the
> `different functions` argument compelling.
+1. Mixing np.foo and math.foo calls is kind of a recipe for disaster
in the general case, I would think.
David
More information about the Numpy-discussion
mailing list