]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-102653: Make recipe docstring show the correct distribution (#102742)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Thu, 16 Mar 2023 14:32:18 +0000 (09:32 -0500)
committerGitHub <noreply@github.com>
Thu, 16 Mar 2023 14:32:18 +0000 (09:32 -0500)
Doc/library/random.rst

index 4522f5a8d26b9d7c5fa2a2279004ee80285953fc..098684d7270ffae81dc5e301e577876b12b2f4e2 100644 (file)
@@ -610,7 +610,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))