summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-04-09 22:34:24 -0700
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-04-09 22:34:24 -0700
commit5e349dc4ffcad2a5d30219b56b3ac33dcd1aadc7 (patch)
treecc66551d7c540a1fc6bddddd352e37e66470c833 /cmd2.py
parent62d8c239312d51d8a1b97e1439f9ad31bb9d5fe0 (diff)
downloadcmd2-git-5e349dc4ffcad2a5d30219b56b3ac33dcd1aadc7.tar.gz
Remove usage of optional type hinting which is not allowed in Python 2.7
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd2.py b/cmd2.py
index 5e9266f7..b461868a 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -42,7 +42,6 @@ import six
import sys
import tempfile
import traceback
-from typing import Union, Callable
import unittest
from code import InteractiveConsole
@@ -213,10 +212,13 @@ REDIRECTION_CHARS = ['|', '<', '>']
HELP_CATEGORY = 'help_category'
-def categorize(func: Union[Callable, Iterable], category: str):
- """
- Categorize a function
+def categorize(func, category):
+ """Categorize a function.
+
The help command output will group this function under the specified category heading
+
+ :param func: Union[Callable, Iterable] - function to categorize
+ :param category: str - category to put it in
"""
if isinstance(func, Iterable):
for item in func: