diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-07-01 20:01:55 +0000 |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-07-01 20:01:55 +0000 |
commit | f220e994d083f9b5024b6f657def0b7ae55218ea (patch) | |
tree | 8e5410fafbf04cb3f8a461c7852dfb6c44120131 /Lib/threading.py | |
parent | b39de0998b6a67811dc6dbafc7982c5c22cba391 (diff) | |
download | cpython-f220e994d083f9b5024b6f657def0b7ae55218ea.tar.gz |
Make the classes exposed by threading.py new-style classes. This is
mostly for convenience and to aid debugging.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 730da675e5..81a2693349 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -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): |