mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
Docs: replace Harry Potter reference with Monty Python (#118130)
This commit is contained in:
parent
51ef89cd9a
commit
1446024124
1 changed files with 3 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue