Docs: replace Harry Potter reference with Monty Python (#118130)

This commit is contained in:
Clément Robert 2024-04-21 20:03:46 +02:00 committed by GitHub
parent 51ef89cd9a
commit 1446024124
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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.