-
Notifications
You must be signed in to change notification settings - Fork 569
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
Add limits+coredis to mypy #537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
@@ -301,7 +310,7 @@ async def try_acquire( | |||
"""Returns when the limit is satisfied for the namespace_and_key. | |||
|
|||
Args: | |||
namespace_and_key (:obj:`tuple[str, str | MatchAllInputs]`): is | |||
namespace_and_key (:obj:`tuple[str, str]`): is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this :obj:
syntax here? Normally it's good to not restate types if they're in the docstring already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's in the style guide for the google doc strings, I think for sphinx compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw, either Sphinx autodoc or napoleon (I can't remember which) will pull in type hints if they are there
https://google.github.io/styleguide/pyguide.html#383-functions-and-methods note that it does not restate type hints in Args
or Returns
https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html in this one, note there's not type hints at all
Anyways, moral of the story I have seen it where people later update or expand type hints, but then don't update the repeated version in the docstring Args
or Returns
I forgot to add to mypy, not it's added. It revealed a couple of type signatures to clean up.