Improve the error message for "choices(population, 10)" by rhettinger · Pull Request #25267 · python/cpython · GitHub
Skip to content

Improve the error message for "choices(population, 10)" - #25267

Merged
rhettinger merged 1 commit into
python:masterfrom
rhettinger:choices_error
Apr 20, 2021
Merged

rhettinger merged 1 commit into
python:masterfrom
rhettinger:choices_error

Conversation

@rhettinger

Copy link
Copy Markdown
Contributor

This a reasonably common error, so improve the error message to make it more obvious what the problem is and how to fix it:

TypeError: The number of choices must be a keyword argument: k=10

@miss-islington

Copy link
Copy Markdown
Contributor

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 20, 2021
(cherry picked from commit 2a36b09)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
@bedevere-bot

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants