From 9bfeb7c550c2fbe4319ed44e4afc0c8c941a136d Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sun, 14 Sep 2025 15:40:52 +0300 Subject: [PATCH 1/6] feat(typing): add annotations to add_tuple --- pytools/__init__.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 30f818f5..80f4979e 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -41,6 +41,7 @@ Iterable, Iterator, Mapping, + MutableSequence, Sequence, ) from functools import reduce, wraps @@ -61,7 +62,14 @@ ) from warnings import warn -from typing_extensions import Self, dataclass_transform, deprecated, override +from typing_extensions import ( + Self, + TypeVarTuple, + Unpack, + dataclass_transform, + deprecated, + override, +) from pytools.version import VERSION_TEXT @@ -275,6 +283,7 @@ T = TypeVar("T") T_co = TypeVar("T_co", covariant=True) T_contra = TypeVar("T_contra", contravariant=True) +Ts = TypeVarTuple("Ts") R = TypeVar("R", covariant=True) F = TypeVar("F", bound=Callable[..., Any]) P = ParamSpec("P") @@ -1064,11 +1073,13 @@ def monkeypatch_class(_name, bases, namespace): # {{{ generic utilities -def add_tuples(t1, t2): +# FIXME: to type these correctly, TypeVarTuple would need to support bounds +def add_tuples(t1: tuple[Unpack[Ts]], t2: tuple[Unpack[Ts]]) -> tuple[Unpack[Ts]]: return tuple(t1v + t2v for t1v, t2v in zip(t1, t2, strict=True)) -def negate_tuple(t1): +# FIXME: to type these correctly, TypeVarTuple would need to support bounds +def negate_tuple(t1: tuple[Unpack[Ts]]) -> tuple[Unpack[Ts]]: return tuple(-t1v for t1v in t1) @@ -1093,8 +1104,8 @@ def shift(vec, dist): return result -def len_iterable(iterable): - return sum(1 for i in iterable) +def len_iterable(iterable: Iterable[object]) -> int: + return sum(1 for _ in iterable) def flatten(iterable: Iterable[Iterable[T]]) -> Iterable[T]: From e51a716ba5c1214555516e9512d3c6d885874ff2 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 15 Sep 2025 11:04:37 +0300 Subject: [PATCH 2/6] feat(typing): type useless FakeList and DependentDictionary --- pytools/__init__.py | 75 ++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 80f4979e..0d3ef426 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -573,75 +573,85 @@ class ImmutableRecord(ImmutableRecordWithoutPickling, Record): # }}} -class Reference: - def __init__(self, value): - self.value = value +class Reference(Generic[T]): + def __init__(self, value: T) -> None: + self.value: T = value - def get(self): + def get(self) -> T: from warnings import warn warn("Reference.get() is deprecated -- use ref.value instead. " "This will stop working in 2025.", stacklevel=2) return self.value - def set(self, value): + def set(self, value: T) -> None: self.value = value -class FakeList: - def __init__(self, f, length): - self._Length = length - self._Function = f +class FakeList(Generic[R]): + def __init__(self, f: Callable[[int], R], length: int) -> None: + self._Length: int = length + self._Function: Callable[[int], R] = f - def __len__(self): + def __len__(self) -> int: return self._Length - def __getitem__(self, index): - try: - return [self._Function(i) - for i in range(*index.indices(self._Length))] - except AttributeError: + @overload + def __getitem__(self, index: int) -> R: ... + + @overload + def __getitem__(self, index: slice) -> Sequence[R]: ... + + def __getitem__(self, index: object) -> R | Sequence[R]: + if isinstance(index, int): return self._Function(index) + elif isinstance(index, slice): + return [self._Function(i) for i in range(*index.indices(self._Length))] + else: + raise TypeError( + f"list indices must be 'int' or 'slice', not '{type(index).__name__}'") # {{{ dependent dictionary -class DependentDictionary: - def __init__(self, f, start=None): +class DependentDictionary(Generic[T, R]): + def __init__(self, + f: Callable[[dict[T, R], T], R], + start: dict[T, R] | None = None) -> None: if start is None: start = {} - self._Function = f - self._Dictionary = start.copy() + self._Function: Callable[[dict[T, R], T], R] = f + self._Dictionary: dict[T, R] = start.copy() - def copy(self): + def copy(self) -> DependentDictionary[T, R]: return DependentDictionary(self._Function, self._Dictionary) - def __contains__(self, key): + def __contains__(self, key: T) -> bool: try: self[key] return True except KeyError: return False - def __getitem__(self, key): + def __getitem__(self, key: T) -> R: try: return self._Dictionary[key] except KeyError: return self._Function(self._Dictionary, key) - def __setitem__(self, key, value): + def __setitem__(self, key: T, value: R) -> None: self._Dictionary[key] = value def genuineKeys(self): # noqa: N802 return list(self._Dictionary.keys()) - def iteritems(self): + def iteritems(self) -> Iterable[tuple[T, R]]: return self._Dictionary.items() - def iterkeys(self): + def iterkeys(self) -> Iterable[T]: return self._Dictionary.keys() - def itervalues(self): + def itervalues(self) -> Iterable[R]: return self._Dictionary.values() # }}} @@ -689,7 +699,7 @@ def is_single_valued( all_equal = is_single_valued -def all_roughly_equal(iterable, threshold): +def all_roughly_equal(iterable: Iterable[object], threshold: float) -> bool: return is_single_valued(iterable, equality_pred=lambda a, b: abs(a-b) < threshold) @@ -1083,7 +1093,7 @@ def negate_tuple(t1: tuple[Unpack[Ts]]) -> tuple[Unpack[Ts]]: return tuple(-t1v for t1v in t1) -def shift(vec, dist): +def shift(vec: MutableSequence[T], dist: int) -> Sequence[T]: """Return a copy of *vec* shifted by *dist* such that .. code:: python @@ -1093,13 +1103,13 @@ def shift(vec, dist): result = vec[:] - N = len(vec) # noqa: N806 - dist = dist % N + n = len(vec) + dist = dist % n # modulo only returns positive distances! if dist > 0: - result[dist:] = vec[:N-dist] - result[:dist] = vec[N-dist:] + result[dist:] = vec[:n-dist] + result[:dist] = vec[n-dist:] return result @@ -1126,6 +1136,7 @@ def linear_combination(coefficients, vectors): result = coefficients[0] * vectors[0] for c, v in zip(coefficients[1:], vectors[1:], strict=True): result += c*v + return result From 3553d95c421715a32c43ab4452ee7f208f4b68d7 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 15 Sep 2025 11:07:42 +0300 Subject: [PATCH 3/6] feat(typing): fix typing in stopwatch --- pytools/stopwatch.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pytools/stopwatch.py b/pytools/stopwatch.py index 4cc80053..6d619b78 100644 --- a/pytools/stopwatch.py +++ b/pytools/stopwatch.py @@ -7,7 +7,7 @@ class StopWatch: def __init__(self) -> None: - self.Elapsed = 0.0 + self.Elapsed: float = 0 self.LastStart: float | None = None def start(self) -> StopWatch: @@ -31,8 +31,8 @@ def elapsed(self) -> float: class Job: def __init__(self, name: str) -> None: - self.Name = name - self.StopWatch = StopWatch().start() + self.Name: str = name + self.StopWatch: StopWatch = StopWatch().start() if self.is_visible(): print(f"{name}...") @@ -52,8 +52,8 @@ def is_visible(self) -> bool: class EtaEstimator: def __init__(self, total_steps: int) -> None: - self.stopwatch = StopWatch().start() - self.total_steps = total_steps + self.stopwatch: StopWatch = StopWatch().start() + self.total_steps: int = total_steps assert total_steps > 0 def estimate(self, done: int) -> float | None: @@ -72,5 +72,5 @@ def print_job_summary() -> None: HIDDEN_JOBS: list[str] = [] VISIBLE_JOBS: list[str] = [] -JOB_TIMES = DependentDictionary(lambda x: 0) +JOB_TIMES = DependentDictionary[str, float](lambda d, x: 0.0) PRINT_JOBS = Reference(True) From c27c3a102e0b135b429f7186745175569ca870e8 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 15 Sep 2025 11:08:43 +0300 Subject: [PATCH 4/6] fix: remove unused SupportsLessThan --- pytools/__init__.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index 0d3ef426..aaacdc2f 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -1324,10 +1324,6 @@ def find_max_where(predicate, prec=1e-5, initial_guess=1, fail_bound=1e38): # {{{ argmin, argmax -class SupportsLessThan(Protocol[T_contra]): - def __lt__(self, other: T_contra, /) -> bool: ... - - @overload def argmin2(iterable: Iterable[tuple[T, SupportsLessThanT]], return_value: Literal[True]) -> tuple[T, SupportsLessThanT]: ... From 3a49dd91f262e336359588bda932b129c4eee9d1 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 15 Sep 2025 11:21:46 +0300 Subject: [PATCH 5/6] feat(typing): more types for Table, typedump, ProgressBar --- pytools/__init__.py | 49 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index aaacdc2f..796b3a23 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -1720,7 +1720,7 @@ def __init__(self, alignments: tuple[str, ...] | None = None) -> None: alignments = tuple(alignments) self.rows: list[tuple[str, ...]] = [] - self.alignments = alignments + self.alignments: tuple[str, ...] = alignments @property def nrows(self) -> int: @@ -1750,7 +1750,7 @@ def _get_alignments(self) -> tuple[str, ...]: + (self.alignments[-1],) * (self.ncolumns - len(self.alignments)) )[:self.ncolumns] - def _get_column_widths(self, rows) -> tuple[int, ...]: + def _get_column_widths(self, rows: list[tuple[str, ...]]) -> tuple[int, ...]: return tuple( max(len(row[i]) for row in rows) for i in range(self.ncolumns) ) @@ -1928,7 +1928,7 @@ def latex(self, if hline_after is None: hline_after = () - lines = [] + lines: list[str] = [] for row_nr, row in enumerate(self.rows[skip_lines:]): lines.append(fr"{' & '.join(row)} \\") if row_nr in hline_after: @@ -1985,7 +1985,7 @@ def merge_tables(*tables: Table, if isinstance(skip_columns, int): skip_columns = (skip_columns,) - def remove_columns(i, row): + def remove_columns(i: int, row: tuple[str, ...]) -> tuple[str, ...]: if i == 0 or skip_columns is None: return row return tuple( @@ -1993,13 +1993,13 @@ def remove_columns(i, row): ) alignments = sum(( - remove_columns(i, tbl._get_alignments()) + remove_columns(i, tbl._get_alignments()) # pyright: ignore[reportPrivateUsage] for i, tbl in enumerate(tables) ), ()) result = Table(alignments=alignments) for i in range(tables[0].nrows): - row = [] + row: list[str] = [] for j, tbl in enumerate(tables): row.extend(remove_columns(j, tbl.rows[i])) @@ -2097,8 +2097,10 @@ def __exit__(self, exc_type, exc_val, exc_tb): del self.stderr_backup -def typedump(val: Any, max_seq: int = 5, - special_handlers: Mapping[type, Callable] | None = None, +def typedump(val: object, max_seq: int = 5, + special_handlers: ( + Mapping[type, Callable[[object], str]] + | None) = None, fully_qualified_name: bool = True) -> str: """ Return a string representation of the type of *val*, recursing into @@ -2125,14 +2127,16 @@ def typedump(val: Any, max_seq: int = 5, else: return hdlr(val) - def objname(obj: Any) -> str: + def objname(obj: object) -> str: if type(obj).__module__ == "builtins": if fully_qualified_name: return type(obj).__qualname__ + return type(obj).__name__ if fully_qualified_name: return type(obj).__module__ + "." + type(obj).__qualname__ + return type(obj).__name__ # Special handling for 'str' since it is also iterable @@ -2199,13 +2203,31 @@ class ProgressBar: .. automethod:: __enter__ .. automethod:: __exit__ """ - def __init__(self, descr: str, total: int, initial: int = 0, + + description: str + total: int + done: int + length: int + + last_squares: int + start_time: float + last_update_time: float + speed_meas_start_time: float + speed_meas_start_done: int + time_per_step: float | None + + def __init__(self, + descr: str, + total: int, + initial: int = 0, length: int = 40) -> None: import time + self.description = descr self.total = total self.done = initial self.length = length + self.last_squares = -1 self.start_time = time.time() self.last_update_time = self.start_time @@ -2213,7 +2235,7 @@ def __init__(self, descr: str, total: int, initial: int = 0, self.speed_meas_start_time = self.start_time self.speed_meas_start_done = initial - self.time_per_step: float | None = None + self.time_per_step = None def draw(self) -> None: import time @@ -2262,7 +2284,10 @@ def finished(self) -> None: def __enter__(self) -> None: self.draw() - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + def __exit__(self, + exc_type: type[BaseException], + exc_val: BaseException | None, + exc_tb: types.TracebackType | None) -> None: self.finished() # }}} From 858f167d09ab0213925335b8a59890c0198ed7e8 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 15 Sep 2025 11:22:03 +0300 Subject: [PATCH 6/6] chore: update baseline --- .basedpyright/baseline.json | 1542 +++-------------------------------- 1 file changed, 126 insertions(+), 1416 deletions(-) diff --git a/.basedpyright/baseline.json b/.basedpyright/baseline.json index 16155f43..f0a075c3 100644 --- a/.basedpyright/baseline.json +++ b/.basedpyright/baseline.json @@ -820,578 +820,26 @@ } }, { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 11, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 18, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 18, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 65, - "lineCount": 2 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 36, - "endColumn": 63, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 36, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 27, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 35, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 51, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 34, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 31, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 20, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 22, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", + "code": "reportGeneralTypeIssues", "range": { - "startColumn": 22, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 32, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 32, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 33, - "endColumn": 34, + "startColumn": 41, + "endColumn": 42, "lineCount": 1 } }, { "code": "reportUnknownLambdaType", "range": { - "startColumn": 36, - "endColumn": 37, + "startColumn": 39, + "endColumn": 59, "lineCount": 1 } }, { - "code": "reportUnknownLambdaType", + "code": "reportOperatorIssue", "range": { - "startColumn": 39, - "endColumn": 59, + "startColumn": 43, + "endColumn": 46, "lineCount": 1 } }, @@ -2414,248 +1862,48 @@ { "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 12, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 14, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 23, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 20, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 11, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 4, - "endColumn": 14, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 15, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 15, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 19, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 19, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 11, - "endColumn": 68, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 17, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 31, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 36, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 47, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 51, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 4, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 17, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 17, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 11, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 17, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 4, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 10, - "endColumn": 13, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 10, - "endColumn": 13, + "startColumn": 8, + "endColumn": 12, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 15, + "startColumn": 14, "endColumn": 19, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 15, - "endColumn": 19, + "startColumn": 23, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 4, - "endColumn": 10, + "startColumn": 20, + "endColumn": 24, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 12, - "endColumn": 15, + "startColumn": 26, + "endColumn": 30, "lineCount": 1 } }, { "code": "reportUnknownVariableType", "range": { - "startColumn": 4, - "endColumn": 8, + "startColumn": 11, + "endColumn": 15, "lineCount": 1 } }, @@ -2663,39 +1911,47 @@ "code": "reportUnknownVariableType", "range": { "startColumn": 11, - "endColumn": 17, + "endColumn": 68, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportOperatorIssue", "range": { "startColumn": 17, - "endColumn": 25, + "endColumn": 26, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownArgumentType", "range": { "startColumn": 17, - "endColumn": 25, + "endColumn": 67, "lineCount": 1 } }, { "code": "reportUnknownVariableType", "range": { - "startColumn": 21, - "endColumn": 22, + "startColumn": 11, + "endColumn": 36, "lineCount": 1 } }, { - "code": "reportUnusedVariable", + "code": "reportOperatorIssue", "range": { - "startColumn": 21, - "endColumn": 22, + "startColumn": 17, + "endColumn": 21, + "lineCount": 1 + } + }, + { + "code": "reportUnknownArgumentType", + "range": { + "startColumn": 17, + "endColumn": 35, "lineCount": 1 } }, @@ -3659,14 +2915,6 @@ "lineCount": 1 } }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 23, - "lineCount": 1 - } - }, { "code": "reportAny", "range": { @@ -3683,94 +2931,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 20, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 32, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 21, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 21, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 47, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 47, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 47, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 47, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 47, - "endColumn": 57, - "lineCount": 1 - } - }, { "code": "reportAny", "range": { @@ -3790,152 +2950,48 @@ { "code": "reportAny", "range": { - "startColumn": 47, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 21, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 13, - "lineCount": 3 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 12, - "endColumn": 73, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 25, - "endColumn": 30, + "startColumn": 47, + "endColumn": 57, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportAny", "range": { - "startColumn": 44, - "endColumn": 47, + "startColumn": 47, + "endColumn": 57, "lineCount": 1 } }, { - "code": "reportPrivateUsage", + "code": "reportAny", "range": { - "startColumn": 30, - "endColumn": 45, + "startColumn": 47, + "endColumn": 57, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAny", "range": { - "startColumn": 12, - "endColumn": 22, + "startColumn": 47, + "endColumn": 57, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportAny", "range": { - "startColumn": 23, - "endColumn": 33, + "startColumn": 47, + "endColumn": 57, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportAny", "range": { - "startColumn": 29, - "endColumn": 32, + "startColumn": 47, + "endColumn": 57, "lineCount": 1 } }, @@ -4268,249 +3324,25 @@ } }, { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 8, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUninitializedInstanceVariable", - "range": { - "startColumn": 13, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 42, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 42, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 13, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 13, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 45, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 12, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 37, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 20, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 16, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 16, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 28, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 24, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 24, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 53, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 20, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportAny", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 12, - "endColumn": 15, + "startColumn": 24, + "endColumn": 43, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 31, - "endColumn": 32, + "startColumn": 8, + "endColumn": 17, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 28, + "startColumn": 8, "endColumn": 29, "lineCount": 1 } @@ -4518,184 +3350,176 @@ { "code": "reportUnknownVariableType", "range": { - "startColumn": 31, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 19, - "endColumn": 22, + "startColumn": 12, + "endColumn": 21, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 32, - "endColumn": 33, + "startColumn": 40, + "endColumn": 50, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 28, - "endColumn": 29, + "startColumn": 13, + "endColumn": 26, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportUninitializedInstanceVariable", "range": { "startColumn": 13, - "endColumn": 24, + "endColumn": 26, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportUnknownParameterType", "range": { - "startColumn": 13, - "endColumn": 18, + "startColumn": 23, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportMissingParameterType", "range": { - "startColumn": 13, - "endColumn": 17, + "startColumn": 23, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportUnknownParameterType", "range": { - "startColumn": 13, - "endColumn": 19, + "startColumn": 33, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportMissingParameterType", "range": { - "startColumn": 13, - "endColumn": 25, + "startColumn": 33, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportUnknownParameterType", "range": { - "startColumn": 13, - "endColumn": 23, + "startColumn": 42, + "endColumn": 48, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportMissingParameterType", "range": { - "startColumn": 13, - "endColumn": 29, + "startColumn": 42, + "endColumn": 48, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportArgumentType", "range": { - "startColumn": 13, - "endColumn": 34, + "startColumn": 12, + "endColumn": 15, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 13, - "endColumn": 34, + "startColumn": 31, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 29, - "endColumn": 55, + "startColumn": 48, + "endColumn": 49, "lineCount": 1 } }, { "code": "reportUnknownVariableType", "range": { - "startColumn": 16, - "endColumn": 33, + "startColumn": 28, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 37, - "endColumn": 63, + "startColumn": 31, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportArgumentType", "range": { - "startColumn": 15, - "endColumn": 33, + "startColumn": 19, + "endColumn": 22, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 24, - "endColumn": 75, + "startColumn": 38, + "endColumn": 39, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 31, - "endColumn": 74, + "startColumn": 32, + "endColumn": 33, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportIndexIssue", "range": { - "startColumn": 56, - "endColumn": 74, + "startColumn": 37, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 23, - "endColumn": 31, + "startColumn": 34, + "endColumn": 35, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownVariableType", "range": { - "startColumn": 38, - "endColumn": 45, + "startColumn": 28, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportGeneralTypeIssues", "range": { - "startColumn": 52, - "endColumn": 58, + "startColumn": 33, + "endColumn": 36, "lineCount": 1 } }, @@ -9356,104 +8180,6 @@ } } ], - "./pytools/stopwatch.py": [ - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 11, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 13, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 14, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 35, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 42, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 39, - "endColumn": 40, - "lineCount": 1 - } - } - ], "./pytools/tag.py": [ { "code": "reportUnannotatedClassAttribute", @@ -12371,22 +11097,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 24, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 57, - "endColumn": 58, - "lineCount": 1 - } - }, { "code": "reportUnknownArgumentType", "range": {