[Python-checkins] python/dist/src/Doc/ref ref5.tex,1.70,1.71

niemeyer@users.sourceforge.net niemeyer@users.sourceforge.net
2002年12月16日 05:54:03 -0800


Update of /cvsroot/python/python/dist/src/Doc/ref
In directory sc8-pr-cvs1:/tmp/cvs-serv20669/Doc/ref
Modified Files:
	ref5.tex 
Log Message:
Fixing bug
[#448679] Left to right
* Python/compile.c
 (com_dictmaker): Reordered evaluation of dictionaries to follow strict
 LTR evaluation.
* Lib/compiler/pycodegen.py
 (CodeGenerator.visitDict): Reordered evaluation of dictionaries to
 follow strict LTR evaluation.
* Doc/ref/ref5.tex
 Documented the general LTR evaluation order idea.
* Misc/NEWS
 Documented change in evaluation order of dictionaries.
Index: ref5.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** ref5.tex	26 Nov 2002 18:14:35 -0000	1.70
--- ref5.tex	16 Dec 2002 13:54:01 -0000	1.71
***************
*** 1027,1030 ****
--- 1027,1048 ----
 \indexii{trailing}{comma}
 
+ \section{Evaluation order\label{evalorder}}
+ \indexii{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:
+ 
+ \begin{verbatim}
+ expr1, expr2, expr3, expr4
+ (expr1, expr2, expr3, expr4)
+ {expr1: expr2, expr3: expr4}
+ expr1 + expr2 * (expr3 - expr4)
+ func(expr1, expr2, *expr3, **expr4)
+ expr3, expr4 = expr1, expr2
+ \end{verbatim}
 
 \section{Summary\label{summary}}

AltStyle によって変換されたページ (->オリジナル) /