[Numpy-discussion] Proposal for changing the names of inverse trigonometrical/hyperbolic functions
Charles R Harris
charlesr.harris@gmail....
Mon Nov 24 16:50:42 CST 2008
On Mon, Nov 24, 2008 at 3:00 PM, David Warde-Farley <dwf@cs.toronto.edu>wrote:
>
> 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.
>
Yes, but many folks will do it for quick and dirty ease. I also don't see
why we need to deprecate the old names, just leave them in there. To add new
names like this, just copy copy the old ufunc definition in the generator
and change "arcsin" to "asin".
I think the currently deprecated C-API functions should also remain with
their warnings. They only amount to about a hundred lines of code.
That said, I'm 0- on this at the moment.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20081124/061d9195/attachment.html
More information about the Numpy-discussion
mailing list