Will McGugan <[EMAIL PROTECTED]> writes:
> Is there a canonical way of storing per-thread data in Python?
mydata = threading.local()
mydata.x = 1
...
http://docs.python.org/lib/module-threading.html
--
http://mail.python.org/mailman/listinfo/python-list
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
--
On Mon, 09 Jul 2007 13:57:02 +0100, Will McGugan <[EMAIL PROTECTED]> wrote:
>Hi,
>
>Is there a canonical way of storing per-thread data in Python?
>
See threading.local:
http://python.org/doc/lib/module-threading.html
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list