From 70b176af406b43dfa58ee74fdf13d6d0a7a60aa9 Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Wed, 1 Nov 2023 10:18:53 -0500 Subject: [PATCH] Move some checkpoint types from list to sequences to tighter constrain mutability (#2929) This is work from benc-mypy branch --- parsl/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parsl/utils.py b/parsl/utils.py index 4f0e27b1dc..55f2ad8b9f 100644 --- a/parsl/utils.py +++ b/parsl/utils.py @@ -7,7 +7,7 @@ import time from contextlib import contextmanager from types import TracebackType -from typing import Any, Callable, List, Tuple, Union, Generator, IO, AnyStr, Dict, Optional +from typing import Any, Callable, List, Sequence, Tuple, Union, Generator, IO, AnyStr, Dict, Optional import typeguard from typing_extensions import Type @@ -47,7 +47,7 @@ def get_version() -> str: @typeguard.typechecked -def get_all_checkpoints(rundir: str = "runinfo") -> List[str]: +def get_all_checkpoints(rundir: str = "runinfo") -> Sequence[str]: """Finds the checkpoints from all runs in the rundir. Kwargs: @@ -76,7 +76,7 @@ def get_all_checkpoints(rundir: str = "runinfo") -> List[str]: @typeguard.typechecked -def get_last_checkpoint(rundir: str = "runinfo") -> List[str]: +def get_last_checkpoint(rundir: str = "runinfo") -> Sequence[str]: """Finds the checkpoint from the last run, if one exists. Note that checkpoints are incremental, and this helper will not find