[issue17388] Providing invalid value to

2013-03-09 Thread Chris Tandiono
New submission from Chris Tandiono: 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 fix

[issue17388] Providing invalid value to random.sample can result in incorrect error message

2013-03-09 Thread Chris Tandiono
Changes by Chris Tandiono : -- title: Providing invalid value to -> Providing invalid value to random.sample can result in incorrect error message ___ Python tracker <http://bugs.python.org/issu

[issue17388] Providing invalid value to random.sample can result in incorrect error message

2013-03-09 Thread Chris Tandiono
Chris Tandiono added the comment: Hmm. I'm not sure I buy the argument that the new message is less useful (wouldn't you like to know the exact values that caused the problem? that's what int() does when you provide it garbage). I guess it could be less informative, since you