File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ def get_latest_fileversions(glob_list_path: list[str] | str) -> list[str]:
2020 - Locally: https://docs.python.org/3/library/glob.html
2121
2222 Args:
23- glob_list_path: List of strings that represents a filepath.
23+ glob_list_path: List of strings or single string that represents a filepath.
2424 Recommend that the list is created with glob operation.
2525
2626 Returns:
2727 list[str]: List of strings with unique filepaths and its latest versions
2828
29+ Raises:
30+ TypeError: If parameter does not fit with type-narrowing to list of strings.
2931
3032 Example::
3133
@@ -40,7 +42,7 @@ def get_latest_fileversions(glob_list_path: list[str] | str) -> list[str]:
4042 infiles = glob_list_path
4143 else :
4244 raise TypeError ("Expecting glob_list_path to be a str or a list of str." )
43-
45+
4446 # Extract unique base names by splitting before the version part
4547 uniques = set (file .rsplit ("_v" , 1 )[0 ] for file in infiles )
4648 result = []
You can’t perform that action at this time.
0 commit comments