Home | History | Annotate | Download | only in python2.7

Lines Matching defs:local

1 """Thread-local objects.
3 (Note that this module provides a Python version of the threading.local
5 faster one available. You should always import the `local` class from
8 Thread-local objects support the management of thread-local data.
9 If you have data that you want to be local to a thread, simply create
10 a thread-local object and use its attributes:
12 >>> mydata = local()
17 You can also access the local-object's dictionary:
26 What's important about thread-local objects is that their data are
27 local to a thread. If we access the data in a different thread:
50 Of course, values you get from a local object, including a __dict__
56 You can create custom local objects by subclassing the local class:
58 >>> class MyLocal(local):
71 called each time the local object is used in a separate thread. This
74 Now if we create a local object:
113 local. They are shared across threads:
115 >>> class MyLocal(local):
136 __all__ = ["local"]
139 # module may also want to use our `local` class, if support for locals
153 key = '_local__key', 'thread.local.' + str(id(self))
186 class local(_localbase):