Ed Schofield wrote: > Last week's discussion on rand() and randn() seemed to indicate a > sentiment that they ought to take tuples for consistency with ones, > zeros, eye, identity, and empty -- that, although they are supposed > to be convenience functions, they are inconvenient precisely because > of their inconsistency with these other functions. This issue has > been raised many times over the past several months. > > Travis made a change in r2572 to allow tuples as arguments, then took > it out again a few hours later, apparently unsure about whether this > was a good idea.
He was experimenting to see if it was technically easy or not. > I'd like to call for a vote on what people would prefer, and then ask > Travis to make a final pronouncement before the feature freeze. > > * Should numpy.rand and numpy.randn accept sequences of dimensions as > arguments, like rand((3,3)), as an alternative to rand(3,3)? -1 This is worse than the problem it's trying to solve. You'll still see the inconsistent rand(3,3) in people's code. > * Should rand((3,3)) and randn((3,3)) continue to raise a TypeError? This is a false dichotomy. There are more choices here. * Remove rand and randn (at least from the toplevel namespace) and promote the use of random_sample and standard_normal which already follow the tuple convention. -- 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 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion