-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Docs: make it easier to reference and markup decorators #105812
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
Comments
cpython/Doc/tools/extensions/pyspecific.py Lines 713 to 714 in da911a6
cpython/Doc/tools/extensions/pyspecific.py Lines 345 to 356 in da911a6
|
I really like the idea of having a I'm not sure how I feel about |
A To note, Sphinx provides built-in enhanced versions of those two directives, so we could probably dump the custom overrides and switched to the fuller-featured, standard versions instead. It wouldn't really change anything either way with a |
I agree. Explicit is better than implicit. |
Implementation-wise, it could be as simple as If you do want that, you should be able to just subclass Of course, this doesn't actually check that the target is actually a decorator, but neither do the other |
I started updating the documentation to make use of the How should we reference objects such as Lines 248 to 249 in f819900
In this case, I'd say we could use Similarly, how should Lines 486 to 504 in f819900
|
@AA-Turner, any reason this was closed? #131426 was closed pointing to this one as the tracking issue. |
I didn't see any open PRs linking to this, and the main work seemed done. A |
I have pending work locally, but wanted to get feedback on #105812 (comment) before continuing. |
I think it's fine to use either the class or deco role when referring to a decorator in the context of it being a class. I think both roles will generate the same cross-reference link. A |
Originally posted by @erlend-aasland in #105792 (comment)
There's already
decorator
anddecoratormethod
directives for signatures. Perhaps we can exploit these so the:py:meth:
andpy:func:
roles adapt the format according to what directive is used. A role could be a nice supplement, though; sometimes we want to explicitly refer to a decorator as a function or the other way around.Linked PRs
The text was updated successfully, but these errors were encountered: