-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
paramiko stubs seem incorrect for python3 #5736
Comments
In this case, you should just use |
The issue can be highlight with the following
The second line causes a mypy arg-type issue, since the stubs say that key_blob is a The key_blob IS a |
Another example : in |
PRs to improve the stubs are welcome :) |
In #10109 I fix two of the specific issues mentioned above. Anything else is best handled in a focused issue/PR that describes exactly what type is wrong. |
I am getting a bunch of errors from mypy with the
types-paramiko
package.Some are imports that are not in the stubs for paramiko like
paramiko.PublicBlob
which is an alias import fromparamiko.pkey.PublicBlob
(see https://github.com/paramiko/paramiko/blob/master/paramiko/__init__.py#L65)Others seem to be issues between python2 and python3 where many of the object stubs are declaring type
str
when in fact paramiko is treating it like abytes
(see https://github.com/python/typeshed/blob/master/stubs/paramiko/paramiko/pkey.pyi#L36 and https://github.com/paramiko/paramiko/blob/master/paramiko/pkey.py#L679-L681)I'm not sure if there is a nice way to resolve this, as it is obviously an
str
in py2 butbytes
in py3.I have currently chosen to ignore the
types-paramiko
package in my project, as it causes too many false check errors with mypy.The text was updated successfully, but these errors were encountered: