bpo-31754: Fix the PyBuffer Documentation - #3993
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. Thanks again to your contribution and we look forward to looking at it! |
| @@ -0,0 +1 @@ | |||
| Fix document entry in c-api/buffer.html. Patch by Aniket Vyas | |||
There was a problem hiding this comment.
A news file is not needed for trivial documentation changes.
|
|
||
|
|
||
| .. c:function:: void PyBuffer_FillContiguousStrides(int ndim, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t itemsize, char order) | ||
| .. c:function:: void PyBuffer_FillContiguousStrides(int ndim, Py_ssize_t *shape, Py_ssize_t *strides, int itemsize, char order) |
There was a problem hiding this comment.
First parameter of this function is named ndims:
Lines 559 to 563 in cd195e2
I'd say go ahead and rename ndim to ndims.
There was a problem hiding this comment.
Thanks for pointing that out. Also, the last parameter is "char fort" rather than "char order" in documentation. Do you want me to change that as well ?
There was a problem hiding this comment.
No, order should stay as-is since it's more readable. It was renamed from fortran to order in 9a2d99e#diff-77786d8cf2602a6684bccbf242e5fc1eR457
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @berkerpeksag: please review the changes made to this pull request. |
|
Thanks @vyas45 for the PR, and @berkerpeksag for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6. |
…ides (pythonGH-3993) (cherry picked from commit 1b9e76e)
|
GH-4005 is a backport of this pull request to the 3.6 branch. |
|
Thanks, @vyas45! |
|
Sorry, @vyas45 and @berkerpeksag, I could not cleanly backport this to |
|
@vyas45 do you have time to create a backport PR for 2.7? |
|
@berkerpeksag Sure thing ! I can work on the backport. However I am quite new to the environment, would you have some instructions on how to do so ? Thanks ! |
|
@vyas45 basically it's the same steps for the master branch. The only difference is that you need to switch to the 2.7 branch first: $ git checkout 2.7
# edit Doc/c-api/buffer.rst manually
# commit your changes
$ git push origin <your-branch>
# and open a PR on GitHub -- you'll need to select 2.7 as a base branch |
|
@berkerpeksag Thanks for the instructions! I checked out the 2.7 branch. Needed a clarification though. In 2.7 , the last argument is "char fortran" which according to your previous comment was moved to "char order" for readability. " No, order should stay as-is since it's more readable. It was renamed from fortran to order in 9a2d99e#diff-77786d8cf2602a6684bccbf242e5fc1eR457 " Would you like me to go ahead and change "fortran" to "order" in 2.7 ? Thanks ! |
|
I personally want to keep modifications to the 2.7 branch minimal so let's keep it 'fortran'. |
|
@berkerpeksag Thanks for the clarification. Also, just to be sure, I am keeping the changes on the first parameter (changing from "ndim" to "ndims"). Regarding committing to the 2.7 branch, I followed the instructions you mentioned. However, after making the point changes to my local branch , pushing and initiating a Pull request, I see a bunch of other changes(a lot of them) along with my changes. Is that how a backport works, being an aggregation of all backports to 2.7 or am I doing something wrong ? Thanks ! |
|
@vyas45 When creating the backport PR, you need to change the base from |
|
@Mariatta thanks a lot ! That worked. |
|
@vyas45 you can also follow the guide at https://help.github.com/articles/creating-a-pull-request-from-a-fork/
That's up to you. Either way is OK for me. |
|
GH-4012 is a backport of this pull request to the 2.7 branch. |
https://bugs.python.org/issue31754