Python quirk in evaluation order

James Stroud jstroud at mbi.ucla.edu
Fri Jul 31 16:11:49 EDT 2009


Python 2.5:

mbi136-176 211% python
*** Pasting of code with ">>>" or "..." has been enabled.
########################################################################
  ##                             ipython                              ##
########################################################################
py> b = 4 if True else b
py> b
4


Isn't the right side supposed to be evaluated first?



More information about the Python-list mailing list