mirror of https://github.com/python/cpython
Docs: replace Harry Potter reference with Monty Python (#118130)
This commit is contained in:
parent
51ef89cd9a
commit
1446024124
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue