diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-11-27 09:33:37 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-11-27 09:33:37 -0500 |
commit | 771e299c153ee20181cbb286a30dfa1450ed9e99 (patch) | |
tree | 81e0a744dc15750a206ff6debb11796b4cf533c0 /coverage/debug.py | |
parent | 0818611c63a243e35a710d325bc63ffa93ef3cd7 (diff) | |
download | python-coveragepy-git-771e299c153ee20181cbb286a30dfa1450ed9e99.tar.gz |
refactor: SimpleReprMixing wasn't simple, it was auto
Also, I'm not sure I like it as a mixin...
Diffstat (limited to 'coverage/debug.py')
-rw-r--r-- | coverage/debug.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coverage/debug.py b/coverage/debug.py index 4286bc50..eca1a5a4 100644 --- a/coverage/debug.py +++ b/coverage/debug.py @@ -30,7 +30,7 @@ FORCED_DEBUG_FILE = None class DebugControl: """Control and output for debugging.""" - show_repr_attr = False # For SimpleReprMixin + show_repr_attr = False # For AutoReprMixin def __init__(self, options, output): """Configure the options and output file for debugging.""" @@ -197,16 +197,16 @@ def add_pid_and_tid(text): return text -class SimpleReprMixin: - """A mixin implementing a simple __repr__.""" - simple_repr_ignore = ['simple_repr_ignore', '$coverage.object_id'] +class AutoReprMixin: + """A mixin implementing an automatic __repr__ for debugging.""" + auto_repr_ignore = ['auto_repr_ignore', '$coverage.object_id'] def __repr__(self): show_attrs = ( (k, v) for k, v in self.__dict__.items() if getattr(v, "show_repr_attr", True) and not callable(v) - and k not in self.simple_repr_ignore + and k not in self.auto_repr_ignore ) return "<{klass} @0x{id:x} {attrs}>".format( klass=self.__class__.__name__, |