Potentially ambiguous rand behaviour #33309
Labels
docs
This change adds or pertains to documentation
randomness
Random number generation and the Random stdlib
I ran into unexpected behaviour today calling the rand function. I expected
rand((2,))
to interpret the tuple as dimensions, whereas it actually interpreted it as the set of values from which to be drawing from randomly.In my opinion, a tuple does not (and should not) represent a 'set of values', but rather be a compound data type where each element has an explicit meaning (such as with dims, where each element of the tuple represents the length of specific dimension), and hence, should not be a valid type for S.
Should this be changed?
The text was updated successfully, but these errors were encountered: