diff options
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r-- | cmd2/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py index d8afd922..d8bdf08d 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -157,3 +157,12 @@ def remove_duplicates(list_to_prune: List) -> List: temp_dict[item] = None return list(temp_dict.keys()) + + +def alphabetical_sort(list_to_sort: List[str]) -> List[str]: + """ + Sorts a list of strings alphabetically + :param list_to_sort: the list being sorted + :return: the sorted list + """ + return sorted(list_to_sort, key=str.casefold) |