]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46728: fix docstring of combinations_with_replacement for consistency (GH-31293)
authorDongGeon Lee <secmatth1996@gmail.com>
Tue, 15 Feb 2022 00:02:21 +0000 (09:02 +0900)
committerGitHub <noreply@github.com>
Tue, 15 Feb 2022 00:02:21 +0000 (09:02 +0900)
Modules/clinic/itertoolsmodule.c.h
Modules/itertoolsmodule.c

index 7f5abe648af8874bcfb5a913f444d38448927187..6a6998082484ca05b04899e1d77ac2914233ba94 100644 (file)
@@ -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]*/
index 0ec65d57381d822d622e4be3ea6725ee5b2c368e..4a7a95730395e615e856cc431a6dcfbf4f59ba7b 100644 (file)
@@ -2924,14 +2924,14 @@ itertools.combinations_with_replacement.__new__
     r: Py_ssize_t
 Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats.
 
-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')
 [clinic start generated code]*/
 
 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;