-
Notifications
You must be signed in to change notification settings - Fork 93
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
Dynamic Docstrings in Sync Client #1077
Conversation
add some orders methods as examples
the async session fixture was breaking sync tests in nox
Is there a way to get these to display in IDEs (I can't get the decorated ones to display in VSCode or Neovim)? |
Not that I am aware of. The way I have the docstrings set up in this PR will display them via Python's |
I messed around with approaches for this and my findings are that the language servers (used for display in IDE) do not execute code (which makes sense!) so the doc annotation or my metaclass approach don't work. What does work, and what I'm now advocating for is:
Will iterate on this for the remainder of the day and see what I can do for one of the clients as an example... |
3ec025c
to
65a933a
Compare
While the approach I took "works" in code-completion and generated docs, it fails mypy type checking since the sync client overrides the async one and provides different type hints on return values (AsyncIterator vs Iterator)... IMHO we should stick w/ the full docstring version. |
This MR enables reference documentation for new synchronous client objects implemented in #1049, and uses a decorator to dynamically populate sync client docstrings from their async client counterparts.