From 21c530985ca17bbc8df95d4a396a59d3c81f8f05 Mon Sep 17 00:00:00 2001 From: LightArrowsEXE Date: Mon, 3 Jun 2024 18:06:14 +0200 Subject: [PATCH] append_to_stem: list -> Iterable --- stgpytools/types/file.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stgpytools/types/file.py b/stgpytools/types/file.py index 1cbfe68..bd27c60 100644 --- a/stgpytools/types/file.py +++ b/stgpytools/types/file.py @@ -99,13 +99,13 @@ def write_lines( ) -> int: return super().write_text('\n'.join(data), encoding, errors, newline) - def append_to_stem(self, suffixes: str | list[str], sep: str = "_") -> SPath: + def append_to_stem(self, suffixes: str | Iterable[str], sep: str = "_") -> SPath: """Append a suffix to the stem of the path""" - if not isinstance(suffixes, list): + if isinstance(suffixes, str): suffixes = [suffixes] - return self.with_stem(sep.join([self.stem] + suffixes)) + return self.with_stem(sep.join([self.stem, *suffixes])) SPathLike = Union[str, Path, SPath]