Docs: Fix typo in random_derangement recipe (GH-138599)

This commit is contained in:
Gilles Peiffer 2025-09-06 22:53:49 +02:00 committed by GitHub
parent bbe00d53e9
commit c117b03385
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -666,7 +666,7 @@ or the :pypi:`more-itertools` project:
"Choose a permutation where no element is in its original position."
seq = tuple(iterable)
if len(seq) < 2:
raise ValueError('derangments require at least two values')
raise ValueError('derangements require at least two values')
perm = list(seq)
while True:
random.shuffle(perm)