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

Add sample, randrange, and getrandbits to B311 random module check? #1215

Open
aripollak opened this issue Jan 8, 2025 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@aripollak
Copy link

aripollak commented Jan 8, 2025

Is your feature request related to a problem? Please describe.
I noticed that random.choice raises a B311 warning here. I assume this is to try to stop someone from using it with a range() in security-related code. I noticed some other random functions that could be used in a similar way but are not currently checked: sample, randrange and getrandbits.

Describe the solution you'd like
Add random.sample, random.randrange, and random.getrandbits to B311 check

Describe alternatives you've considered
None

Additional context
N/A

Love this idea? Give it a 👍. We prioritize fulfilling features with the most 👍.

@aripollak aripollak added the enhancement New feature or request label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant