Per thread data

Gerhard Häring gh at ghaering.de
Mon Jul 9 15:11:56 CEST 2007


Will McGugan wrote:
> Hi,
> 
> Is there a canonical way of storing per-thread data in Python?

Good question.

There's threading.local() which creates a thread-local object for you.

Maybe this Cookbook entry is helpful:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/302088

-- Gerhard



More information about the Python-list mailing list