From 1b61df2d96981c1c3a162b3f5df2755f8d56b7dd Mon Sep 17 00:00:00 2001 From: Merlin Fisher-Levine Date: Tue, 27 Jan 2026 08:46:11 -0800 Subject: [PATCH] Improve type annotations for sequence_to_string --- python/lsst/utils/iteration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lsst/utils/iteration.py b/python/lsst/utils/iteration.py index 180b7aec..a5c4dd39 100644 --- a/python/lsst/utils/iteration.py +++ b/python/lsst/utils/iteration.py @@ -17,7 +17,7 @@ __all__ = ["chunk_iterable", "ensure_iterable", "isplit", "sequence_to_string"] import itertools -from collections.abc import Iterable, Iterator, Mapping +from collections.abc import Iterable, Iterator, Mapping, Sequence from typing import Any, TypeGuard, TypeVar @@ -207,7 +207,7 @@ def _is_list_of_ints(values: list[int | str]) -> TypeGuard[list[int]]: return all(isinstance(v, int) for v in values) -def sequence_to_string(values: list[int | str]) -> str: +def sequence_to_string(values: Sequence[int | str]) -> str: """Convert a list of integers or strings into a compact string representation by merging consecutive values or sequences.