diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2004-07-15 11:52:40 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2004-07-15 11:52:40 (GMT) |
commit | 00457170908e4e887f5dd879528172ddf3491039 (patch) | |
tree | 61981e79c999d6f86d9e67c502384fa9cd665afc /Doc/whatsnew | |
parent | 23406894ea48813daa004ba075c32b1125940165 (diff) | |
download | cpython-00457170908e4e887f5dd879528172ddf3491039.zip cpython-00457170908e4e887f5dd879528172ddf3491039.tar.gz cpython-00457170908e4e887f5dd879528172ddf3491039.tar.bz2 |
Add thread-local feature
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/whatsnew24.tex | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Doc/whatsnew/whatsnew24.tex b/Doc/whatsnew/whatsnew24.tex index 6b2d0f8..2e62823 100644 --- a/Doc/whatsnew/whatsnew24.tex +++ b/Doc/whatsnew/whatsnew24.tex @@ -847,12 +847,29 @@ data extractors when used with \function{map()} or % XXX sre is now non-recursive. +\item The \module{threading} module now has an elegantly simple way to support +thread-local data. The module contains a \class{local} class whose +attribute values are local to different threads. + +\begin{verbatim} +import threading + +data = threading.local() +data.number = 42 +data.url = ('www.python.org', 80) +\end{verbatim} + +Other threads can assign and retrieve their own values for the +\member{number} and \member{url} attributes. You can subclass +\class{local} to initialize attributes or to add methods. +(Contributed by Jim Fulton.) + \item The \module{weakref} module now supports a wider variety of objects including Python functions, class instances, sets, frozensets, deques, arrays, files, sockets, and regular expression pattern objects. \item The \module{xmlrpclib} module now supports a multi-call extension for -tranmitting multiple XML-RPC calls in a single HTTP operation. +transmitting multiple XML-RPC calls in a single HTTP operation. \end{itemize} |