]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-102653: Make recipe docstring show the correct distribution (GH-102742)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 16 Mar 2023 14:42:23 +0000 (07:42 -0700)
committerGitHub <noreply@github.com>
Thu, 16 Mar 2023 14:42:23 +0000 (07:42 -0700)
(cherry picked from commit b0ec6253c9cf1b22b87cd99f317dbaeb31263b20)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Doc/library/random.rst

index c7d94e0680f0eb4f4665025af9b7e693b026f212..c7620b03284345326c9cf9ec14448effb0d2f8f0 100644 (file)
@@ -589,7 +589,8 @@ from the combinatoric iterators in the :mod:`itertools` module:
        return tuple(pool[i] for i in indices)
 
    def random_combination_with_replacement(iterable, r):
-       "Random selection from itertools.combinations_with_replacement(iterable, r)"
+       "Choose r elements with replacement.  Order the result to match the iterable."
+       # Result will be in set(itertools.combinations_with_replacement(iterable, r)).
        pool = tuple(iterable)
        n = len(pool)
        indices = sorted(random.choices(range(n), k=r))