pep 308: why doing (almost) nothing suffices

Erik Max Francis max at alcyone.com
Sun Mar 9 21:07:58 EST 2003


"Edward K. Ream" wrote:

> def choose_eval(cond, a, b): # warning: evals all arguments
> 
>     if cond: return eval(a)
>     else: return eval(b)
> 
> Heavy duty stuff by my present bathtub standards.  So to "delay" the
> evaluation of an argument, just quote it.  Wow--just like lithp. 

This was actually brought up during the PEP 308 debate.  The problem
with it is that it doesn't do the whole tokenization and compilation
phase at the same time; it holds some off until later.  This is a
potential performance problemi f the choose_eval code appears in a loop,
which it likely will find itself at some point.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ There are defeats more triumphant than victories.
\__/ Montaigne
    Max Pandaemonium / http://www.maxpandaemonium.com/
 A sampling of Max Pandameonium's music.




More information about the Python-list mailing list