Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bpo-29453: Remove reference to undefined dictionary ordering in Tutorial #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Doc/tutorial/controlflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,7 @@ function like this::
for arg in arguments:
print(arg)
print("-" * 40)
keys = sorted(keywords.keys())
for kw in keys:
for kw in keywords:
print(kw, ":", keywords[kw])

It could be called like this::
Expand All @@ -513,13 +512,13 @@ and of course it would print:
It's very runny, sir.
It's really very, VERY runny, sir.
----------------------------------------
client : John Cleese
shopkeeper : Michael Palin
client : John Cleese
sketch : Cheese Shop Sketch

Note that the list of keyword argument names is created by sorting the result
of the keywords dictionary's ``keys()`` method before printing its contents;
if this is not done, the order in which the arguments are printed is undefined.
Note that the order in which the keyword arguments are printed is guaranteed
to match the order in which they were provided in the function call.


.. _tut-arbitraryargs:

Expand Down