diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-12-29 13:57:52 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-12-29 13:57:52 -0500 |
commit | cde67d3a710b20fbe25a1e22aeaa1a0ed552ae6f (patch) | |
tree | be61ea6ddd70a3b8bbcce62a661bccf1dbc7f616 /coverage/types.py | |
parent | 124b3758c0da8c8fa9f11bfd93700cdcf52a789d (diff) | |
download | python-coveragepy-git-cde67d3a710b20fbe25a1e22aeaa1a0ed552ae6f.tar.gz |
mypy: check sqldata.py
Diffstat (limited to 'coverage/types.py')
-rw-r--r-- | coverage/types.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/coverage/types.py b/coverage/types.py index ee5ae010..015c3747 100644 --- a/coverage/types.py +++ b/coverage/types.py @@ -14,6 +14,8 @@ else: class Protocol: # pylint: disable=missing-class-docstring pass +## Configuration + # One value read from a config file. TConfigValue = Union[str, List[str]] # An entire config section, mapping option names to values. @@ -44,7 +46,26 @@ class TConfigurable(Protocol): """ +## Parsing + # Line numbers are pervasive enough that they deserve their own type. TLineNo = int TArc = Tuple[TLineNo, TLineNo] + +## Debugging + +class TWarnFn(Protocol): + """A callable warn() function.""" + def __call__(self, msg: str, slug: Optional[str]=None, once: bool=False,) -> None: + ... + + +class TDebugCtl(Protocol): + """A DebugControl object, or something like it.""" + + def should(self, option: str) -> bool: + """Decide whether to output debug information in category `option`.""" + + def write(self, msg: str) -> None: + """Write a line of debug output.""" |