diff --git a/Doc/library/random.rst b/Doc/library/random.rst index c7d94e0680f0eb..c7620b03284345 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -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))