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 Chris.Tandiono
Recipients Chris.Tandiono
Date 2013-03-09.09:07:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Currently, random.sample(population, k) raises a ValueError if k is out of the range of [0, len(population)], inclusive. However, the message says "Sample larger than population" even when the real problem is that k < 0. The attached patch fixes that.

The problem exists in all versions of Python that have the random.sample function.

I think I should be adding tests for this, but I don't know in what existing file, if any, this test should go into.
Date User Action Args
2013-03-09 09:07:29Chris.Tandionosetrecipients: + Chris.Tandiono
2013-03-09 09:07:29Chris.Tandionosetmessageid: <>
2013-03-09 09:07:29Chris.Tandionolinkissue17388 messages
2013-03-09 09:07:29Chris.Tandionocreate