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

@choice([1]) takes > 1 minute while @choice([1,2]) takes less than a second #3

Open
mobiusklein opened this issue Mar 25, 2014 · 0 comments

Comments

@mobiusklein
Copy link

I'm using Random.choice() to select from a list of one or more items generated at random. Quite frequently the lists were of length 1, but the script would stall on the choice. I can work around it by adding a length check, and taking the [0] of the list if it is length 1 and otherwise using choice, but it seems like an issue the library might face a lot.

I think any function that depends upon @_randbelow will suffer from this problem too.

I've already forked and started writing a fix. Is there a test script?

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

No branches or pull requests

1 participant