[Python-checkins] Delete a broken threading.local example (#5870)

Alex Gaynor webhook-mailer at python.org
Sun Feb 25 10:03:43 EST 2018


https://github.com/python/cpython/commit/5fb632e83136399bad9427ee23ec8b771695290a
commit: 5fb632e83136399bad9427ee23ec8b771695290a
branch: master
author: Aaron Gallagher <habnabit at users.noreply.github.com>
committer: Alex Gaynor <alex.gaynor at gmail.com>
date: 2018-02-25T10:03:40-05:00
summary:

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.

files:
M Lib/_threading_local.py

diff --git a/Lib/_threading_local.py b/Lib/_threading_local.py
index 4ec4828144b7..245bd0ac91b7 100644
--- a/Lib/_threading_local.py
+++ b/Lib/_threading_local.py
@@ -56,11 +56,7 @@
 
   >>> 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 @@
   >>> thread.start()
   >>> thread.join()
   >>> log
-  [[('color', 'red'), ('initialized', True)], 11]
+  [[('color', 'red')], 11]
 
 without affecting this thread's data:
 



More information about the Python-checkins mailing list