-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Corrected formatting of multi-line code block #13806
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
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This improves over the current formatting which makes 2 lines appear as a single line at https://docs.python.org/3/c-api/buffer.html#numpy-style-shape-and-strides. With PR
Thanks.
@tirkarthi You're welcome. Should I do anything about the missing semicolon at the end of the first line? |
I guess for the short snippet semicolon is implicit. I don't have a strong opinion about it. Maybe you can add it if the core dev who will be merging it makes the suggestion. |
Since this is C code, there should likely be a semicolon at the end of that line. Certainly in a code example in the docs, there should be a semicolon at the end of a simple statement. Please do add it while we're here! |
@taleinat Done. Sorry it took so long. I usually take less than 8 days to type one character :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISTM we should use .. code-block:: c
for this code block, so that it is properly marked up as C code.
Incorrect formatting can be seen here: https://docs.python.org/3/c-api/buffer.html#numpy-style-shape-and-strides
@taleinat I added the |
Indeed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @madphysicist for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
(cherry picked from commit bd26a44) Co-authored-by: Joseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>
GH-14805 is a backport of this pull request to the 3.8 branch. |
(cherry picked from commit bd26a44) Co-authored-by: Joseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>
GH-14806 is a backport of this pull request to the 3.7 branch. |
(cherry picked from commit bd26a44) Co-authored-by: Joseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>
(cherry picked from commit bd26a44) Co-authored-by: Joseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>
Thanks for contributing this fix, @madphysicist! |
You're welcome. |
Trivial change. Replaced
``
around block with::
before it.