]> granicus.if.org Git - python/commitdiff
Make the classes exposed by threading.py new-style classes. This is
authorTim Peters <tim.peters@gmail.com>
Tue, 1 Jul 2003 20:01:55 +0000 (20:01 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 1 Jul 2003 20:01:55 +0000 (20:01 +0000)
mostly for convenience and to aid debugging.

Lib/threading.py
Misc/NEWS

index 730da675e543390a4dfba6ada7de5be068dea2e7..81a26933494eadf1d839d0527a320f430da90246 100644 (file)
@@ -24,13 +24,17 @@ ThreadError = thread.error
 del thread
 
 
-# Debug support (adapted from ihooks.py)
+# Debug support (adapted from ihooks.py).
+# All the major classes here derive from _Verbose.  We force that to
+# be a new-style class so that all the major classes here are new-style.
+# This helps debugging (type(instance) is more revealing for instances
+# of new-style classes).
 
 _VERBOSE = False
 
 if __debug__:
 
-    class _Verbose:
+    class _Verbose(object):
 
         def __init__(self, verbose=None):
             if verbose is None:
@@ -46,7 +50,7 @@ if __debug__:
 
 else:
     # Disable this when using "python -O"
-    class _Verbose:
+    class _Verbose(object):
         def __init__(self, verbose=None):
             pass
         def _note(self, *args):
index d3761f946b5c0654803c78ae1d634cd9c63285a6..84da7572df3f423a415993b53171dcb555b317fb 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -24,6 +24,9 @@ Extension modules
 Library
 -------
 
+- The classes in threading.py are now new-style classes.  That they
+  weren't before was an oversight.
+
 - SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
   when there are no lines.