[SciPy-dev] Definition of class multiarray

Robert Kern robert.kern@gmail....
Fri Jun 26 15:30:53 CDT 2009


On Fri, Jun 26, 2009 at 15:28, David Goldsmith<d_l_goldsmith@yahoo.com> wrote:
>
> --- On Fri, 6/26/09, Robert Kern <robert.kern@gmail.com> wrote:
>
>> Goldsmith<d_l_goldsmith@yahoo.com>
>> wrote:
>> >
>> > OK, tried to figure it out myself, but:
>> >
>> > Do ndarray.<method>s which have an "equivalent"
>> numpy.<method> actually call the numpy method to
>> operate on self?
>>
>> Note that the latter are called functions, not methods.
>
> Sorry, of course, my bad.
>
>> Where there is
>> an equivalence, the function calls the method, not vice
>> versa. Take a
>> look at the source of numpy.std, for instance.
>
> Interesting; why?

It's much easier to implement that way.

> Because presently we're doing the doc the other way: if someone does help(ndarray.<method>) (and there's an equivalent numpy function) they're referred to the function for (detailed) help. :-)  Granted, this "reversal" probably doesn't matter since which is calling which isn't typically seen by the user, but I just thought I'd note it in case anyone has a problem with it (and thus wants to discuss it further).

It really doesn't matter.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the Scipy-dev mailing list