We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a297d59 commit b0ec625Copy full SHA for b0ec625
Doc/library/random.rst
@@ -610,7 +610,8 @@ from the combinatoric iterators in the :mod:`itertools` module:
610
return tuple(pool[i] for i in indices)
611
612
def random_combination_with_replacement(iterable, r):
613
- "Random selection from itertools.combinations_with_replacement(iterable, r)"
+ "Choose r elements with replacement. Order the result to match the iterable."
614
+ # Result will be in set(itertools.combinations_with_replacement(iterable, r)).
615
pool = tuple(iterable)
616
n = len(pool)
617
indices = sorted(random.choices(range(n), k=r))
0 commit comments