PEP-308 a "simplicity-first" alternative

Terry Reedy tjreedy at udel.edu
Sat Feb 15 02:15:25 CET 2003


"Erik Max Francis" <max at alcyone.com> wrote in message
news:3E4C8329.1C13F41A at alcyone.com...
> Bengt Richter wrote:
>
> > I take it think that Python's and/or semantics was a design
mistake.
> > Perhaps so ;-)
>
> 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_.

What do you mean when you say it is 'wrong' to combine two selection
operators to make a selection expression?  I really am baffled.  You
surely do not think it is wrong to combine operators of other types,
so why the special no-combine rule for this pair?  (Again, see
(PEP-308) Python's Conditional Selection Operators for my
understanding of and/or.)  It seems to me that you perhaps do think
their definition is wrong, in spite of what you said (because to me,
if components are ok, so is their combination).

> What PEP 308 seeks to find is a _conditional operator_ that stands
on
> its own and is something the community can live with.

Fine with me.

Terry J. Reedy






More information about the Python-list mailing list