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

Chris Tandiono report at bugs.python.org
Sun Mar 10 00:32:33 CET 2013


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 have to decide for yourself whether it's too large or too small a value.

At any rate, I think that whatever modification(s) you make to the message, it shouldn't say "Sample larger than population" when k < 0, because that's just plain misleading.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17388>
_______________________________________


More information about the Python-bugs-list mailing list