sh
sh copied to clipboard
Type Annotations
It'd be nice if this package shipped mypy type annotations.
That would have to wait for removal of Python 2 support. We're tracking various improvements suggested for a 2.0 release in https://github.com/amoffat/sh/issues/552, among them dropping support for Python 2.
Are there specific type annotations you are looking for @remexre ?
Not any specific thing, I just get errors from mypy about it not having type annotations.
Ok, I will run mypy on sh.py and take care of the findings. It looks like there are only 5 on the release/v2.0.0
branch:
(sh-chCS6MrZ-py3.8) ➜ sh git:(feature/v2.0.0) ✗ mypy sh.py
sh.py:196: error: Name "Poller" already defined on line 118
sh.py:379: error: Need type annotation for "rc_exc_cache" (hint: "rc_exc_cache: Dict[<type>, <type>] = ...")
sh.py:472: error: Incompatible types in assignment (expression has type "Callable[[Any, VarArg(Any), KwArg(Any)], Any]", variable has type "Callable[[AnyStr, DefaultNamedArg(bool, 'recursive')], List[AnyStr]]")
sh.py:891: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[object], int]")
sh.py:1109: error: Need type annotation for "_call_args"
Found 5 errors in 1 file (checked 1 source file)
Python 2.0 support is now removed in 2.0.0, and mypy sh.py
is clean