How can I get the global instance of Python’s random.Random
class? The one that is used by the global random.choice()
functions etc.
Looking at the source code it is available as random._inst
. The underscore indicates it’s private so use at your own risk, however it does work.