[issue28475] Misleading error on random.sample when k < 0

2016-11-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks Franscisco. I ended-up not modifying the docs because I think it clutters that clarity with an irrelevant side issue. The more important part was to make sure the error message wasn't misleading and the test that edge case. I didn't backport to

[issue28475] Misleading error on random.sample when k < 0

2016-11-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 89f95c78e0ab by Raymond Hettinger in branch '3.6': Issue 28475: Improve error message for random.sample() with k < 0. (Contributed by Francisco Couzo). https://hg.python.org/cpython/rev/89f95c78e0ab -- nosy: +python-dev

[issue28475] Misleading error on random.sample when k < 0

2016-10-19 Thread Francisco Couzo
Changes by Francisco Couzo : Added file: http://bugs.python.org/file45144/random_sample2.patch ___ Python tracker ___

[issue28475] Misleading error on random.sample when k < 0

2016-10-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would rather revise the existing message to say that it cannot be negative or larger that population. -- ___ Python tracker

[issue28475] Misleading error on random.sample when k < 0

2016-10-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: docs@python -> rhettinger components: -Tests nosy: +mark.dickinson, rhettinger stage: -> patch review type: -> behavior versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7

[issue28475] Misleading error on random.sample when k < 0

2016-10-19 Thread Francisco Couzo
New submission from Francisco Couzo: Improved a bit the error message when k < 0, and also added a comment about it on the documentation and an additional test case. -- assignee: docs@python components: Documentation, Library (Lib), Tests files: random_sample.patch keywords: patch