[Numpy-discussion] Args for rand and randn: call for a vote

Alan G Isaac aisaac at american.edu
Wed Jul 12 09:42:11 EDT 2006


Robert makes his case clearly and persuasively.
Without pretending to challenge his argument in any way,
I would just like to clarify what is at issue
for some of the teaching crowd (or for me in any case).

- Get up and running very quickly even with students who 
  lack a programming background.  This means having rand() 
  and randn() in the top-level namespace is nice, since 
  I use them early and often.
- Avoid confusion and frustration.  This is the basis for 
  having a "consistent" calling convention for array 
  constructors (pace Robert's arguments about consistency).


On Tue, 11 Jul 2006, Robert Kern apparently wrote: 
> And mark my words, if we make rand() polymorphic, we will 
> get just as many newbies coming to the list asking why 
> ones(3, 4) doesn't work.

That is plausible.
If polymorphism is chosen for rand() and randn(), I suppose 
I would address this by documenting the current API as 
present for backwards compatability only.  That allows 
a quick answer, but perhaps does not preclude the questions.

Cheers,
Alan Isaac








More information about the NumPy-Discussion mailing list