From 09f9188e826f900198d638ee3c42b27bca29597d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 31 Dec 2022 22:08:25 -0500 Subject: mypy: add env.py --- coverage/debug.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'coverage/debug.py') diff --git a/coverage/debug.py b/coverage/debug.py index b770066b..7ed8937c 100644 --- a/coverage/debug.py +++ b/coverage/debug.py @@ -15,6 +15,8 @@ import sys import types import _thread +from typing import Any, Callable, Iterable, Iterator, Tuple + from coverage.misc import isolate_module os = isolate_module(os) @@ -108,7 +110,7 @@ def info_header(label): return "--{:-<60s}".format(" "+label+" ") -def info_formatter(info): +def info_formatter(info: Iterable[Tuple[str, Any]]) -> Iterator[str]: """Produce a sequence of formatted lines from info. `info` is a sequence of pairs (label, data). The produced lines are @@ -135,7 +137,11 @@ def info_formatter(info): yield "%*s: %s" % (label_len, label, data) -def write_formatted_info(write, header, info): +def write_formatted_info( + write: Callable[[str], None], + header: str, + info: Iterable[Tuple[str, Any]], +) -> None: """Write a sequence of (label,data) pairs nicely. `write` is a function write(str) that accepts each line of output. -- cgit v1.2.1