Skip to content

bpo-46728: fix docstring of combinations_with_replacement for consistency #31293

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

Merged
merged 4 commits into from
Feb 15, 2022

Conversation

LeeDongGeon1996
Copy link
Contributor

@LeeDongGeon1996 LeeDongGeon1996 commented Feb 12, 2022

  • Update docstring for combinations_with_replacement.

https://bugs.python.org/issue46728

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@LeeDongGeon1996

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@AlexWaygood AlexWaygood added skip news docs Documentation in the Doc dir labels Feb 12, 2022
@rhettinger rhettinger added the needs backport to 3.10 only security fixes label Feb 12, 2022
@rhettinger rhettinger self-assigned this Feb 12, 2022
@sweeneyde
Copy link
Member

sweeneyde commented Feb 12, 2022

Be sure to re-run the argument clinic so clinic/itertoolsmodule.c.h is updated to match this.

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run make clinic before submitting the patch.
When I ran the command, the following diff is generated.

diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h
index 7f5abe648a..6a69980824 100644
--- a/Modules/clinic/itertoolsmodule.c.h
+++ b/Modules/clinic/itertoolsmodule.c.h
@@ -414,7 +414,7 @@ PyDoc_STRVAR(itertools_combinations_with_replacement__doc__,
 "\n"
 "Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats.\n"
 "\n"
-"combinations_with_replacement(\'ABC\', 2) --> AA AB AC BB BC CC\"");
+"combinations_with_replacement(\'ABC\', 2) --> (\'A\',\'A\'), (\'A\',\'B\'), (\'A\',\'C\'), (\'B\',\'B\'), (\'B\',\'C\'), (\'C\',\'C\')");

 static PyObject *
 itertools_combinations_with_replacement_impl(PyTypeObject *type,
@@ -667,4 +667,4 @@ skip_optional_pos:
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=5364de2e143609b9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5cb14d4a3fe8aeec input=a9049054013a1b77]*/
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 347913752b..4a7a957303 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -2931,7 +2931,7 @@ static PyObject *
 itertools_combinations_with_replacement_impl(PyTypeObject *type,
                                              PyObject *iterable,
                                              Py_ssize_t r)
-/*[clinic end generated code: output=48b26856d4e659ca input=dc2a8c7ba785fad7]*/
+/*[clinic end generated code: output=48b26856d4e659ca input=1dc58e82a0878fdc]*/
 {
     cwrobject *co;
     Py_ssize_t n;

@bedevere-bot
Copy link

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@LeeDongGeon1996
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@corona10, @rhettinger: please review the changes made to this pull request.

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@corona10 corona10 merged commit 278fdd3 into python:main Feb 15, 2022
@miss-islington
Copy link
Contributor

Thanks @LeeDongGeon1996 for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @LeeDongGeon1996 and @corona10, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 278fdd3e3a2492665b2c2888fd2f428f7f59a3f5 3.10

@LeeDongGeon1996
Copy link
Contributor Author

@corona10 Does it need another PR after cherry-pick?

LeeDongGeon1996 added a commit to LeeDongGeon1996/cpython that referenced this pull request Feb 15, 2022
LeeDongGeon1996 added a commit to LeeDongGeon1996/cpython that referenced this pull request Feb 15, 2022
…consistency (pythonGH-31293).

(cherry picked from commit 278fdd3)

Co-authored-by: DongGeon Lee <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Feb 15, 2022
@bedevere-bot
Copy link

GH-31350 is a backport of this pull request to the 3.10 branch.

@corona10 corona10 added the needs backport to 3.9 only security fixes label Feb 15, 2022
@miss-islington
Copy link
Contributor

Thanks @LeeDongGeon1996 for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @LeeDongGeon1996 and @corona10, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 278fdd3e3a2492665b2c2888fd2f428f7f59a3f5 3.9

LeeDongGeon1996 added a commit to LeeDongGeon1996/cpython that referenced this pull request Feb 15, 2022
…onsistency (pythonGH-31293).

(cherry picked from commit 278fdd3)

Co-authored-by: DongGeon Lee <[email protected]>
@bedevere-bot
Copy link

GH-31356 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Feb 15, 2022
corona10 pushed a commit that referenced this pull request Feb 15, 2022
corona10 pushed a commit that referenced this pull request Feb 15, 2022
@LeeDongGeon1996 LeeDongGeon1996 deleted the patch-1 branch February 15, 2022 13:45
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants