[SciPy-user] Inconsistent function calls?

Ivo Maljevic ivo.maljevic at gmail.com
Thu May 21 12:13:18 EDT 2009


2009/5/21 Robert Kern <robert.kern at gmail.com>

>
> > I do not see any python imposed limitation at making ones(3,3) by default
> > returning
> > what ones([3,3]) does, the same way random.rand(3,3) does,
>
> As has been said several times already, there is one: ones() takes an
> optional second argument, the dtype. That is the Python-imposed
> limitation.
>

Robert, by following this list I know that I shouldn't even try to respond
to your message as
you always turn out to be right, but I'll try anyway. Yes, there is a
limitation if you
take into account that that is how ones() is implemented now, but there is
no limitation that
prevents this function from being modified. But, as you said, rand() and
rand() are not
the norm but the exception, so that is fine.

> BTW, the reason why I included that error message in my previous message
> is
> > because
> > I think it is completely non-helpful.
>
> It's telling you exactly what the problem is, but it is necessarily
> brief and general-purpose. It can't read your mind to try to figure
> out what you expected to happen and tailor its message to that. Any
> time you see an error with arguments, you should always then read the
> function's docstring which should enlighten you more thoroughly.
>

How about "The second argument is not dtype"? Still brief ...



> --
> 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
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090521/396e1290/attachment.html>


More information about the SciPy-User mailing list