[Python-Dev] Proposal: thread.get_dict

Phillip J. Eby pje at telecommunity.com
Mon Jun 28 12:37:45 EDT 2004

At 10:50 AM 6/28/04 -0400, Jim Fulton wrote:

>We often want to associate data with threads.  Python
>manages a dictionary per-tread for this purpose, but there's
>currently no way to get to this dictionary from Python.
>I propose, for 2.4, to add a get_dict method to the thread
>module that will return this dictionary.  This will be
>implemented via a call to PyThreadState_GetDict.
>Any objections?

What's wrong with using (e.g. setting attributes on) 
'threading.currentThread()'?  It's already implemented and available in 2.3 
(and numerous prior versions).

More information about the Python-Dev mailing list