[3.9] bpo-46728: fix docstring of combinations_with_replacement for consistency (GH-31293). (GH-31356)

This commit is contained in:
DongGeon Lee 2022-02-15 21:22:01 +09:00 committed by GitHub
parent 1933238983
commit ad47db34be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -385,7 +385,7 @@ PyDoc_STRVAR(itertools_combinations_with_replacement__doc__,
"\n" "\n"
"Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats.\n" "Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats.\n"
"\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 * static PyObject *
itertools_combinations_with_replacement_impl(PyTypeObject *type, itertools_combinations_with_replacement_impl(PyTypeObject *type,
@ -642,4 +642,4 @@ skip_optional_pos:
exit: exit:
return return_value; return return_value;
} }
/*[clinic end generated code: output=392c9706e79f6710 input=a9049054013a1b77]*/ /*[clinic end generated code: output=0c2799c88400b63f input=a9049054013a1b77]*/

View File

@ -2793,14 +2793,14 @@ itertools.combinations_with_replacement.__new__
r: Py_ssize_t r: Py_ssize_t
Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats. 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]*/ [clinic start generated code]*/
static PyObject * static PyObject *
itertools_combinations_with_replacement_impl(PyTypeObject *type, itertools_combinations_with_replacement_impl(PyTypeObject *type,
PyObject *iterable, PyObject *iterable,
Py_ssize_t r) Py_ssize_t r)
/*[clinic end generated code: output=48b26856d4e659ca input=dc2a8c7ba785fad7]*/ /*[clinic end generated code: output=48b26856d4e659ca input=1dc58e82a0878fdc]*/
{ {
cwrobject *co; cwrobject *co;
Py_ssize_t n; Py_ssize_t n;