-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Docs: make it easier to reference and markup decorators #105812
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 |
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: