diff -r ea4728ef5956 Doc/tutorial/controlflow.rst --- a/Doc/tutorial/controlflow.rst Sat Feb 04 17:36:47 2017 -0800 +++ b/Doc/tutorial/controlflow.rst Sun Feb 05 18:39:12 2017 +0200 @@ -492,8 +492,7 @@ 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:: @@ -513,13 +512,10 @@ It's very runny, sir. It's really very, VERY runny, sir. ---------------------------------------- + shopkeeper : Michael Palin client : John Cleese - shopkeeper : Michael Palin 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. .. _tut-arbitraryargs: