From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 21 Apr 2024 18:10:15 +0000 (+0200) Subject: [3.12] Docs: replace Harry Potter reference with Monty Python (GH-118130) (#118135) X-Git-Tag: v3.12.4~189 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d87cb494ba27ef5c2a4a59240a7ed792bb0bcce;p=thirdparty%2FPython%2Fcpython.git [3.12] Docs: replace Harry Potter reference with Monty Python (GH-118130) (#118135) Docs: replace Harry Potter reference with Monty Python (GH-118130) (cherry picked from commit 1446024124fb98c3051199760380685f8a2fd127) Co-authored-by: Clément Robert --- diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index 9913309a3942..694a43f9e035 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -800,18 +800,18 @@ guarantee about output. For example, when printing a set, Python doesn't guarantee that the element is printed in any particular order, so a test like :: >>> foo() - {"Hermione", "Harry"} + {"spam", "eggs"} is vulnerable! One workaround is to do :: - >>> foo() == {"Hermione", "Harry"} + >>> foo() == {"spam", "eggs"} True instead. Another is to do :: >>> d = sorted(foo()) >>> d - ['Harry', 'Hermione'] + ['eggs', 'spam'] There are others, but you get the idea.