]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Docs: Fix typo in `random_derangement` recipe (GH-138599)
authorGilles Peiffer <gilles.peiffer.yt@gmail.com>
Sat, 6 Sep 2025 20:53:49 +0000 (22:53 +0200)
committerGitHub <noreply@github.com>
Sat, 6 Sep 2025 20:53:49 +0000 (16:53 -0400)
Doc/library/random.rst

index e9cebf46d57b01ddffaee81cd014d6fb4eecf071..4e55e301b89095faac0765eee985d14ca9bc06df 100644 (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)