Commit e558e4b
committed
Fixed mypy 2.2.0 failures
mypy 2.2.0 updated its typeshed definitions for argparse.ArgumentParser to align with recent updates to the standard library in newer Python versions (such as the addition of the file argument for output coloring and the
optional formatter parameter).
These new type stub signatures broke our overrides in cmd2/argparse_utils.py:
- _get_formatter failed because the typeshed stub specifies it can accept an optional parameter file positionally, but our override only captured keyword arguments (**_kwargs: Any).
- format_help failed because our override strictly took no arguments (def format_help(self)), while the base class accepts formatter.1 parent aca7d06 commit e558e4b
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | | - | |
| 1038 | + | |
1039 | 1039 | | |
1040 | 1040 | | |
1041 | 1041 | | |
1042 | | - | |
| 1042 | + | |
1043 | 1043 | | |
1044 | | - | |
| 1044 | + | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
| |||
0 commit comments