Skip to content

Commit

Permalink
append_to_stem: list -> Iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Jun 3, 2024
1 parent 39f3093 commit 21c5309
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stgpytools/types/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit 21c5309

Please sign in to comment.