[Python-Dev] Status of Lib/_threading_local.py ?

Antoine Pitrou solipsis at pitrou.net
Wed Aug 4 02:43:39 CEST 2010


Hello,

While Lib/_threading_local.py is meant as a fallback Python
implementation of thread-local objects, it looks like it will never be
invoked in practice. The reason is that the thread-local code in
Modules/_threadmodule.c in unconditionally compiled. Furthermore,
_threading_local.py imports threading which itself imports _thread, so
it's not possible for _threading_local to function if for some reason
_thread fails to build or import.

What should we do with _threading_local? Keep it as an example of a
Python implementation (which is vastly slower than what a C
implementation can do and also currently less robust), or plainly
remove it?

Regards

Antoine.




More information about the Python-Dev mailing list