We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0560fe3 commit 4a7faacCopy full SHA for 4a7faac
Doc/library/random.rst
@@ -589,7 +589,8 @@ from the combinatoric iterators in the :mod:`itertools` module:
589
return tuple(pool[i] for i in indices)
590
591
def random_combination_with_replacement(iterable, r):
592
- "Random selection from itertools.combinations_with_replacement(iterable, r)"
+ "Choose r elements with replacement. Order the result to match the iterable."
593
+ # Result will be in set(itertools.combinations_with_replacement(iterable, r)).
594
pool = tuple(iterable)
595
n = len(pool)
596
indices = sorted(random.choices(range(n), k=r))
0 commit comments