Content-Length: 6021 | pFad | https://docs.python.org/2.2/ref/evalorder.html

5.13 Evaluation order

 
5.13 Evaluation order

 

Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side.

In the following lines, expressions will be evaluated in the arithmetic order of their suffixes:

expr1, expr2, expr3, expr4
(expr1, expr2, expr3, expr4)
expr1 + expr2 * (expr3 - expr4)
func(expr1, expr2, *expr3, **expr4)
expr3, expr4 = expr1, expr2

Dictionaries are currently an exception to the rule and they evaluate in the following order:

{expr2: expr1, expr4: expr3}

In Python 2.3, the order will be changed to be consistent with other expressions:

{expr1: expr2, expr3: expr4}

See About this document... for information on suggesting changes.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://docs.python.org/2.2/ref/evalorder.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy