Skip to content

Commit 5e349dc

Browse files
committed
Remove usage of optional type hinting which is not allowed in Python 2.7
1 parent 62d8c23 commit 5e349dc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmd2.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import sys
4343
import tempfile
4444
import traceback
45-
from typing import Union, Callable
4645
import unittest
4746
from code import InteractiveConsole
4847

@@ -213,10 +212,13 @@ class RlType(Enum):
213212
HELP_CATEGORY = 'help_category'
214213

215214

216-
def categorize(func: Union[Callable, Iterable], category: str):
217-
"""
218-
Categorize a function
215+
def categorize(func, category):
216+
"""Categorize a function.
217+
219218
The help command output will group this function under the specified category heading
219+
220+
:param func: Union[Callable, Iterable] - function to categorize
221+
:param category: str - category to put it in
220222
"""
221223
if isinstance(func, Iterable):
222224
for item in func:

0 commit comments

Comments
 (0)