This patch changes the backing datastructures of "register_random()"
and a few internal caches to use "weakref.WeakKeyDictionary". This
reduces memory usage and may improve performance when registered
"Random" instances are only used for a subset of your tests (issue
#3131).
The canonical version of these notes (with links) is on readthedocs.