This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eng793
Recipients eng793
Date 2012-09-01.02:06:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346465179.1.0.118516816378.issue15837@psf.upfronthosting.co.za>
In-reply-to
Content
Random.shuffle does not have a test in test_random.py; the attached patch adds this test. In addition, I rewrote the documentation string for Random.shuffle, which apparently did not reflect recent changes in the code and was inconsistent with the definition of the method. This change is also part of this patch; I was not sure if this merited a separate issue, so I just included this here.

On a related matter: in Random.shuffle there is a third optional argument which looks very odd to me:

def shuffle(self, x, random=None, int=int):
....

Besides being confusing to a user typing help(shuffle), what the "int" argument does in shuffle is to convert a float to an integer. But one could pass any one-argument function in principle, and it would be then very hard to predict what shuffle would do... it would not "shuffle" any more in the traditional sense - not with a uniform probability distribution. In summary, I don't see how that argument could be useful, although the people who wrote the library must have had something in mind... if so it would be a good idea to document it.
History
Date User Action Args
2012-09-01 02:06:19eng793setrecipients: + eng793
2012-09-01 02:06:19eng793setmessageid: <1346465179.1.0.118516816378.issue15837@psf.upfronthosting.co.za>
2012-09-01 02:06:18eng793linkissue15837 messages
2012-09-01 02:06:17eng793create