-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Use :const: and :data: as appropriate #98750
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
Conversation
I hadn't previously realized that |
|
@erlend-aasland , @ezio-melotti , myself and possibly others had a discussion about this previously, which I can't find at the moment (I think it started on one of Erlend's PRs and might have spilled over to the devguide and/or docs-community). I'm usually one of the more slavish about always using the semantically correct roles, and we could use
|
If we did want to change the display of the constants docs-wide, the better way to do it would be to just add a Sphinx extension, either a custom subclass of the literal role or a transform node visitor that made inline literal nodes that had the content |
I believe this provides zero benefit. We've had this markup for a very long time and AFAICT it has never been a point of confusion. There is no actual user problem being solved by this PR, but as another respondent noted, the PR may create distraction that we didn't have before. Thanks for the suggestion, but I think we should decline. |
As we've noted, though, there are still a few other non-controversial fixes/improvements here besides the |
@ezio-melotti Thanks for the comment. I was just starting from the point of noticing at least four ways of specifying these constants:
(Just guessing at what i need to enter to preserve the markup. Not seeing a preview feature in the app on my phone. Apologies...) I picked the one which looked more like formal markup. It never occurred to me that correct usage would be documented somewhere. (Apparently, neither did some earlier authors.) I will read the rest of the comments and fix the PR. I'll also go back and adjust the earlier changes to |
FYI, I tried to re-open this PR for you, but it seemed you created another one, #98765 , using the same branch (so it wouldn't let me, but it did clue me in to the fact there was another PR, given it wasn't referenced anywhere here or there). In the future, you should be able to just re-open the PR yourself (or any of us would have for you), instead of having to create a whole new one, and if you do create a new one for some reason, its a good practice to link the new one on the old one (and/or vice versa) so us and others can follow the history. Thanks! |
Actually, I believe contributors are unable to reopen a PR if it's been closed by a maintainer or triager |
Ah, I couldn't find any documentation on that, and I saw Skip was still an org member so I assumed he'd been left with triage rights in any case (since it would let me re-open it), but I guess not. |
But you're a triager — I think you have privileges to reopen any PR! |
Yup; as mentioned, I'd mistakenly assumed Skip was left with triage rights after retiring as a core dev, and hadn't actually checked to confirm that (and instead just hedged my bets using "should" and mentioning that we could in a parenthetical). |
Rather straightforward conversion of references to True, False, None, sys.stdin and sys.stdout to use the appropriate Sphinx(?) constructs, :const: and :data: