Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f9b9e26a
Commit
f9b9e26a
authored
Jul 15, 2004
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Typo fixes
parent
88ff6cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/_threading_local.py
Lib/_threading_local.py
+4
-4
No files found.
Lib/_threading_local.py
View file @
f9b9e26a
"""Thread-local objects
(Note that this module provides a Python version of thread
threading.local class. De
o
ending on the version of Python you're
threading.local class. De
p
ending on the version of Python you're
using, there may be a faster one available. You should always import
the local class from threading.)
Thread-local objects support the management of thread-local data.
If you have data that you want to be local to a thread, simply create
a thread-local object and use it
'
s attributes:
a thread-local object and use its attributes:
>>> mydata = local()
>>> mydata.number = 42
...
...
@@ -100,7 +100,7 @@ As before, we can access the data in a separate thread:
>>> log
[[('color', 'red'), ('initialized', True)], 11]
without
effecting this thread
s data:
without
affecting this thread'
s data:
>>> mydata.number
2
...
...
@@ -229,7 +229,7 @@ class local(_localbase):
try
:
del
__dict__
[
key
]
except
KeyError
:
pass
# didn't have nything in this thread
pass
# didn't have
a
nything in this thread
return
__del__
__del__
=
__del__
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment