Is Python's order of evaluation of function arguments and operands deterministic (+ where is it documented)?
问题 C doesn\'t guarantee any evaluation order so a statement like f(g1()+g2(), g3(), g4()) might execute g1() , g2() , g3() , and g4() in any order (although f() would be executed after all of them) 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. Test program: def somefunc(prolog, epilog): print prolog def f(a, b, *args): print epilog return f def f(text): print text return 1