[SciPy-user] Inconsistent function calls?

Alan G Isaac aisaac@american....
Thu May 21 11:13:44 CDT 2009

On 5/21/2009 11:48 AM Stéfan van der Walt apparently wrote:
> We have decided to use func(shape) as the standard interface, so you
> may see randn and rand as exceptions.

And recall that some people argued long ago that these
exceptions would just prove confusing.
That is my view, although I guess it is too late now. ...

Recall that random.rand
is just a "convenience function" for random.random,
and the only "convenience" is that it accepts a
nonstandard argument.  The docs are fairly explicit about

    "This is a convenience function. If you want an interface that
    takes a shape-tuple as the first argument, refer to `random`."

I say "fairly explicit" because it will not be clear to
a new user exactly what the "convenience" is and how
unusual the interface is.  (Iirc, only rand and randn
do this.)

Alan Isaac

More information about the SciPy-user mailing list