title: Is Python's order of evaluation of function arguments and operands deterministic (+ where is it documented)?
body: <p>C doesn't <a href="http://en.cppreference.com/w/c/language/eval_order" rel="noreferrer">guarantee any evaluation order</a> so a statement like <code>f(g1()+g2(), g3(), g4())</code> might execute <code>g1()</code>, <code>g2()</code>, <code>g3()</code>, and <code>g4()</code> in any order (although <code>f()</code> would be executed after all of them)</p>
  
  <p><strong>What about Python? My experimentation for Python 2.7 shows that it appears to be left-to-right order of evaluation but I wonder if this is specified to be the case.</strong></p>
  
  <p>Test program:</p>
  
  <pre><code>def somefunc(prolog, epilog):
      print prolog
      def f(a, b, *args):
          print epilog
      return f        
  
  def f(text):
      print text
      return 1
  
  somefunc('f1','f2')(f('hey'),f('ho'),f('hahaha'),f('tweedledee')+f('tweedledum'))
  </code></pre>
  
  <p>which prints</p>
  
  <pre><code>f1
  hey
  ho
  hahaha
  tweedledee
  tweedledum
  f2
  </code></pre>