savagezen / dnd-tools

ARCHIVE - MOVED TO GITLAB | Interactive CLI tools for Dungeons and Dragons 5e
https://gitlab.com/savagezen/dnd-tools
GNU Affero General Public License v3.0
164 stars 34 forks source link

Improvements #4

Closed Kronuz closed 6 years ago

Kronuz commented 6 years ago
savagezen commented 6 years ago

@Kronuz Thanks for your interest and help!

There was a specific effort made to keep with the Python 3(.6) standard of using secrets.choice() instead of random.randint() in this commit. I'm not sure which I'd prefer to be used. If you resubmit replacing random.randint() with secrets.choice() I'd be happy to merge.

Kronuz commented 6 years ago

It is very much the same thing, now that I’m using random.SystemRandom, since you don’t really use any of the other functions specific to secrets; and using random gives us backward compatibility.

Kronuz commented 6 years ago

It is actually exactly what secrets uses. Except secrets is only available in Python 3.6+

https://github.com/python/cpython/blob/master/Lib/secrets.py#L22