title: Are keywords automatically sorted in Python 3?
body: <p>I am studying <a href="https://docs.python.org/3/tutorial/controlflow.html" rel="nofollow noreferrer">Python3 tutorial on keyword arguments</a> and couldn't reproduce the output due to the following code:</p>
  
  <pre><code>def cheeseshop(kind, *arguments, **keywords):
      print("-- Do you have any", kind, "?")
      print("-- I'm sorry, we're all out of", kind)
      for arg in arguments:
          print(arg)
      print("-" * 40)
      for kw in keywords:
          print(kw, ":", keywords[kw])
  
  cheeseshop("Limburger", "It's very runny, sir.",
             "It's really very, VERY runny, sir.",
             shopkeeper="Michael Palin",
             client="John Cleese",
             sketch="Cheese Shop Sketch")
  
  -- Do you have any Limburger ?
  -- I'm sorry, we're all out of Limburger
  It's very runny, sir.
  It's really very, VERY runny, sir.
  ----------------------------------------
  shopkeeper : Michael Palin
  client : John Cleese
  sketch : Cheese Shop Sketch 
  </code></pre>
  
  <p>What I got was a sorted dict:</p>
  
  <pre><code>----------------------------------------
  client : John Cleese
  shopkeeper : Michael Palin
  sketch : Cheese Shop Sketch
  </code></pre>
  
  <p>So I tried without calling cheeseshop(): </p>
  
  <pre><code>&gt;&gt;&gt; kw = {'shopkeeper':"Michael Palin", 'client':"John Cleese", 'sketch':"Cheese Shop Sketch"}
  &gt;&gt;&gt; kw
  {'client': 'John Cleese', 'shopkeeper': 'Michael Palin', 'sketch': 'Cheese Shop Sketch'}
  </code></pre>
  
  <p>It looks like in version 3.5, the keys are automatically sorted. But in version 2.7, they aren't:</p>
  
  <pre><code>&gt;&gt;&gt; kw
  {'shopkeeper': 'Michael Palin', 'sketch': 'Cheese Shop Sketch', 'client': 'John Cleese'}
  </code></pre>
  
  <p>and I have to sort it in <a href="https://stackoverflow.com/questions/17677523/python-keyword-output-interpretation">2.7</a> to agree with 3.5.</p>
  
  <pre><code>&gt;&gt;&gt; for k in sorted(kw):
  ...     print(k + " : " + kw[k])
  ... 
  client : John Cleese
  shopkeeper : Michael Palin
  sketch : Cheese Shop Sketch
  </code></pre>
  
  <p>So the statement in the tutorial: "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." should be only applied to version 2.7, not 3.5. Is this true?</p>