summaryrefslogtreecommitdiff
path: root/cmd2/argparse_custom.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2021-02-21 11:46:09 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2021-02-21 11:46:09 -0500
commitccb50f33b5cdff1f354bdc24618a6c665f3ab68a (patch)
treee918fab3b62b78929b298492187aa26c70f73b6c /cmd2/argparse_custom.py
parent9c60ac6f3169f9df37e6c5166844fb9cf5f6766d (diff)
downloadcmd2-git-ccb50f33b5cdff1f354bdc24618a6c665f3ab68a.tar.gz
Start making small changes to fix mypy warnings
Diffstat (limited to 'cmd2/argparse_custom.py')
-rw-r--r--cmd2/argparse_custom.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py
index d3f819b2..2c71dec3 100644
--- a/cmd2/argparse_custom.py
+++ b/cmd2/argparse_custom.py
@@ -203,6 +203,7 @@ from argparse import (
from typing import (
Any,
Callable,
+ NoReturn,
Optional,
Tuple,
Type,
@@ -264,7 +265,7 @@ class CompletionItem(str):
return super().__new__(cls, value)
# noinspection PyUnusedLocal
- def __init__(self, value: object, desc: str = '', *args, **kwargs) -> None:
+ def __init__(self, value: object, desc: str = '', *args) -> None:
"""
CompletionItem Initializer
@@ -273,7 +274,7 @@ class CompletionItem(str):
:param args: args for str __init__
:param kwargs: kwargs for str __init__
"""
- super().__init__(*args, **kwargs)
+ super().__init__(*args)
self.description = desc
@@ -340,7 +341,7 @@ orig_actions_container_add_argument = argparse._ActionsContainer.add_argument
def _add_argument_wrapper(
self,
*args,
- nargs: Union[int, str, Tuple[int], Tuple[int, int], None] = None,
+ nargs: Union[int, str, Tuple[int], Tuple[int, int], Tuple[int, float], None] = None,
choices_provider: Optional[Callable] = None,
completer: Optional[Callable] = None,
suppress_tab_hint: bool = False,
@@ -812,7 +813,7 @@ class Cmd2ArgumentParser(argparse.ArgumentParser):
return super().add_subparsers(**kwargs)
- def error(self, message: str) -> None:
+ def error(self, message: str) -> NoReturn:
"""Custom override that applies custom formatting to the error message"""
lines = message.split('\n')
linum = 0