PEP-308 a "simplicity-first" alternative

David Eppstein eppstein at ics.uci.edu
Fri Feb 14 01:46:57 EST 2003


In article <3E4C8329.1C13F41A at alcyone.com>,
 Erik Max Francis <max at alcyone.com> wrote:

> There is nothing wrong with Python's `and' and `or' semantics; they're
> very similar in functionality to those used in Lisp, for instance. 
> However, the use of the _idiom_ combining the two in order to attempt to
> the effect of a conditional operator -- `C and x or y' -- is idiomatic,
> unreadable, and _wrong_.  There are ways to fix it (with single-element
> lists or lambdas) that make it not wrong, but even more idiomatic and
> unreadable.  These aren't good solutions.

I think PEP was a subtle plot on Guido's part to get us to learn about 
the virtues of readability.

-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/




More information about the Python-list mailing list