schmichael/mmstats — pull request #24 by schmichael (2012-10-02 00:45:41+00:00)
Title: Automatically create per-thread instances of MmStats models

MmStats models are *not* threadsafe, but creating an-instance-per-thread is tedious and error prone...

...unless your model just subclasses threading.local. In which case the threading.local base class will happily call __init__ every time a global instance is used from a new thread.

See: https://bitbucket.org/mirror/cpython/src/ed76eac4491e/Lib/_threading_local.py#cl-56