From dbb94d570a2042409400c28ba3069dcb32a45159 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 4 Jan 2023 07:03:10 -0500 Subject: mypy: summary.py, test_summary.py, tests/coveragetest.py --- coverage/misc.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'coverage/misc.py') diff --git a/coverage/misc.py b/coverage/misc.py index a2ac2fed..9b42d841 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -22,7 +22,7 @@ import types from types import ModuleType from typing import ( Any, Callable, Dict, Generator, IO, Iterable, List, Mapping, Optional, - Tuple, TypeVar, Union, + Sequence, Tuple, TypeVar, Union, ) from coverage import env @@ -361,10 +361,12 @@ def human_sorted(strings: Iterable[str]) -> List[str]: """ return sorted(strings, key=_human_key) +SortableItem = TypeVar("SortableItem", bound=Sequence[Any]) + def human_sorted_items( - items: Iterable[Tuple[str, Any]], + items: Iterable[SortableItem], reverse: bool=False, -) -> List[Tuple[str, Any]]: +) -> List[SortableItem]: """Sort (string, ...) items the way humans expect. The elements of `items` can be any tuple/list. They'll be sorted by the -- cgit v1.2.1