[Python-checkins] python/nondist/peps pep-0308.txt,1.1,1.2

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
2003年2月07日 12:18:50 -0800


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1:/tmp/cvs-serv31913
Modified Files:
	pep-0308.txt 
Log Message:
explain why adding a new builtin won't work.
Index: pep-0308.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0308.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pep-0308.txt	7 Feb 2003 17:03:31 -0000	1.1
--- pep-0308.txt	7 Feb 2003 20:18:45 -0000	1.2
***************
*** 99,102 ****
--- 99,111 ----
 is a requirement for being Pythonic -- list comprehensions don't).
 
+ Many people suggest adding a new builtin instead of extending the
+ syntax of the language, e.g.:
+ 
+ ifelse(condition, expression1, expression2)
+ 
+ This won't work the way a syntax extension will because both
+ expression1 and expression2 must be evaluated before the function
+ is called. There's no way to short-circuit the expression
+ evaluation.
 
 Copyright

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