summaryrefslogtreecommitdiffstats
path: root/Lib/_threading_local.py
diff options
context:
space:
mode:
authorAaron Gallagher <habnabit@users.noreply.github.com>2018-02-25 15:03:40 (GMT)
committerAlex Gaynor <alex.gaynor@gmail.com>2018-02-25 15:03:40 (GMT)
commit5fb632e83136399bad9427ee23ec8b771695290a (patch)
tree93660f87f3eaf42daf1cfb6719a048317d9c5587 /Lib/_threading_local.py
parent29eab55309b9f78b79074d26db16a44e7841c639 (diff)
downloadcpython-5fb632e83136399bad9427ee23ec8b771695290a.zip
cpython-5fb632e83136399bad9427ee23ec8b771695290a.tar.gz
cpython-5fb632e83136399bad9427ee23ec8b771695290a.tar.bz2
Delete a broken threading.local example (#5870)
This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true.
Diffstat (limited to 'Lib/_threading_local.py')
-rw-r--r--Lib/_threading_local.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/_threading_local.py b/Lib/_threading_local.py
index 4ec4828..245bd0a 100644
--- a/Lib/_threading_local.py
+++ b/Lib/_threading_local.py
@@ -56,11 +56,7 @@ You can create custom local objects by subclassing the local class:
>>> class MyLocal(local):
... number = 2
- ... initialized = False
... def __init__(self, **kw):
- ... if self.initialized:
- ... raise SystemError('__init__ called too many times')
- ... self.initialized = True
... self.__dict__.update(kw)
... def squared(self):
... return self.number ** 2
@@ -97,7 +93,7 @@ As before, we can access the data in a separate thread:
>>> thread.start()
>>> thread.join()
>>> log
- [[('color', 'red'), ('initialized', True)], 11]
+ [[('color', 'red')], 11]
without affecting this thread's data: