4 from typing
import Any, Set
6 logger = logging.getLogger(__name__)
10 logger.info(f
"Saving object of type {type(obj)} to {file_path}")
11 with open(file_path,
"wb")
as f:
16 logger.info(f
"Loading {file_path}")
17 with open(file_path,
"rb")
as f:
18 s: Set[str] = pickle.load(f)
19 if not isinstance(s, set):
20 msg = f
"Saved object is not a set. Type: {type(s)}"
24 if not isinstance(element, str):
25 msg = f
"Set element is not a string. Type: {type(element)}"