-
Notifications
You must be signed in to change notification settings - Fork 983
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
Associate docstrings with public constants #2471
Conversation
- Add `cirq/_doc.py` with a `document` function - Pass public constants into `document` when they are initialized - Fixes the fact that e.g. [`cirq.OP_TREE` was being documented using `typing.Union`'s docstring](https://cirq.readthedocs.io/en/stable/generated/cirq.OP_TREE.html
So there's a way to do this in sphinx -- sortof. If you read the documentation (particularly for the OP_TREE = Union[Operation, OpTree]
"""loo loo loo""" At first blush this doesn't work. That's because I think it's important to clearly understand the limitations of autodoc before we re-implement (parts of) it |
Where did you find documentation on the tilde modifier? |
A very good question. I learned it at some point and was actually trying to find documentation on it to see if there were additional options to control the degree of name qualification but alas I couldn't find anything about |
After group discussion (including @mpharrigan ), we decided to go with this |
cirq/_doc.py
with adocument
functiondocument
when they are initializedcirq.OP_TREE
was being documented usingtyping.Union
's docstring