Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07c13ee

Browse files
Delete a broken threading.local example (pythonGH-5870)
This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true. (cherry picked from commit 5fb632e) Co-authored-by: Aaron Gallagher <[email protected]>
1 parent df1732a commit 07c13ee

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Lib/_threading_local.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@
5757
5858
>>> class MyLocal(local):
5959
... number = 2
60-
... initialized = False
6160
... def __init__(self, **kw):
62-
... if self.initialized:
63-
... raise SystemError('__init__ called too many times')
64-
... self.initialized = True
6561
... self.__dict__.update(kw)
6662
... def squared(self):
6763
... return self.number ** 2
@@ -98,7 +94,7 @@
9894
>>> thread.start()
9995
>>> thread.join()
10096
>>> log
101-
[[('color', 'red'), ('initialized', True)], 11]
97+
[[('color', 'red')], 11]
10298
10399
without affecting this thread's data:
104100

0 commit comments

Comments
 (0)