Proposed PEP for a Conditional Expression

thp at cs.ucr.edu thp at cs.ucr.edu
Wed Sep 12 07:26:01 EDT 2001


Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> wrote:
: Tue, 11 Sep 2001 12:26:04 +0000 (UTC), thp at cs.ucr.edu <thp at cs.ucr.edu> pisze:

:>       WORKAROUND_7
:>            >  eval( c and "<expression a>" or "<expression b>" )
:>            I don't like this hack either, but under interpretative 
:>            execution it's probably more efficient than creating 
:>            one-member lists (see WORKAROUND_3).

: I don't believe.

You're right; it's way slower.  (For reasons that now make no sense to
me, I had hoped that eval cached its translated code.)

Tom Payne



More information about the Python-list mailing list