diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-24 23:24:23 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-09-24 23:24:23 -0400 |
commit | 572dde333b81dbf364d383c61e282cc0b4e74f7f (patch) | |
tree | 5fdcec561aa97a8661bcdf26b5982dd49b812965 /cmd2/utils.py | |
parent | 9e4ea5c2079376a451ccd3c6ae9ec03301164064 (diff) | |
download | cmd2-git-572dde333b81dbf364d383c61e282cc0b4e74f7f.tar.gz |
Backing up macro command work
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r-- | cmd2/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py index bdb488cc..3527236f 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -6,7 +6,7 @@ import collections import os import re import unicodedata -from typing import Any, List, Optional, Union +from typing import Any, Iterable, List, Optional, Union from . import constants @@ -194,7 +194,7 @@ def norm_fold(astr: str) -> str: return unicodedata.normalize('NFC', astr).casefold() -def alphabetical_sort(list_to_sort: List[str]) -> List[str]: +def alphabetical_sort(list_to_sort: Iterable[str]) -> List[str]: """Sorts a list of strings alphabetically. For example: ['a1', 'A11', 'A2', 'a22', 'a3'] @@ -232,7 +232,7 @@ def natural_keys(input_str: str) -> List[Union[int, str]]: return [try_int_or_force_to_lower_case(substr) for substr in re.split('(\d+)', input_str)] -def natural_sort(list_to_sort: List[str]) -> List[str]: +def natural_sort(list_to_sort: Iterable[str]) -> List[str]: """ Sorts a list of strings case insensitively as well as numerically. |