-
Notifications
You must be signed in to change notification settings - Fork 76
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
Type annotation for retrieve's known_hash should be str or None #332
Comments
Hi @BjoernLudwigPTB! Thanks for opening this issue. You are absolutely right, the BTW, which IDE are you using? Do you know what code parser or language server is the one that complains about it? Does it parse the docstring of the function to check for valid types? I'm just asking out of curiosity. |
I am using PyCharm and I guess they are parsing the docstring as well. Unfortunately I don't know any details on how they conclude but usually they seem pretty well informed. 😉 Pooch's code base does not contain any type hints yet, right? Are you guys planing on introducing them? |
Thanks for the info on your IDE, it's good to know what other people are using and how they interact with our code. We don't have type hints on any Fatiando library. And we are not still sure if we are going to introduce them, I think we are still considering the pros and cons, and the work it requires to implement them in entire libraries. I think you should follow #330 if you're interested in this. Thanks again for your contribution @BjoernLudwigPTB! |
Ah, nice, thanks for the heads up! I will browse through your extensive answer there. I am glad I could help out here! |
Page that contains the error or needs to be improved:
https://www.fatiando.org/pooch/latest/api/generated/pooch.retrieve.html#pooch.retrieve
Description of the problem/suggestion:
The page states as allowed type only
str
butNone
can be provided as well, as the documentation reflects the code behaviour correctly.None
is not of typestr
, so my IDE (and everybody else's as well I suppose) complains aboutNone
being provided. I know it is not recommended, but still it is implemented and expected to be possible. The documentation should reflect that. I am happy to provide a quick PR on that, if that is desired. I assume the only change needed would be in line 79 like:The text was updated successfully, but these errors were encountered: