Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return list instead of tuple in choices_distribution #1485

Merged
merged 1 commit into from Jul 22, 2021

Conversation

svisser
Copy link
Contributor

@svisser svisser commented Jul 22, 2021

What does this changes

This is a proposed fix for #1484.

It appears this line has come up in the past: #1367 (comment) and #1368 (review).

What was wrong

We should not return a tuple here as that type is not the same as what random.choices (below it) would return (assuming the default implementation in the standard library). The else part below it also uses a choices list to return at the end.

How this fixes it

This adds a test case for random_letters in general and it specifically asserts that the return value is a list, as mentioned in the docstring of random_letters().

@svisser svisser force-pushed the return-list-in-choices-distribution branch from cb1bb8e to f76cb54 Compare July 22, 2021 20:36
@svisser svisser force-pushed the return-list-in-choices-distribution branch from f76cb54 to ae884fb Compare July 22, 2021 20:45
@svisser svisser marked this pull request as ready for review July 22, 2021 20:57
@fcurella
Copy link
Collaborator

Thank you!

@fcurella fcurella merged commit e27c113 into joke2k:master Jul 22, 2021
@svisser svisser deleted the return-list-in-choices-distribution branch July 22, 2021 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants