PEP-308 a "simplicity-first" alternative

Dave Brueck dave at pythonapocrypha.com
Wed Feb 12 00:43:40 EST 2003


On Wed, 12 Feb 2003, holger krekel wrote:

> > > i don't think it's "entirely non-obvious" for you anymore?
> >
> > Well, I've tried to objectively "try out" each proposal so far and,
> > frankly, this is by far the least readable to me. It's basically the same
> > old and-or trick, which IMO isn't readable either.
> >
> > What I like about the other proposals is that, even if you aren't familiar
> > with them, you have a very good chance of correctly guessing what they are
> > trying to express.
>
> Agreed, though guessing what "x and y else z" means is not exactly
> impossible.  The goal with this idea is to fix the one problem with
> the current ternary op-idiom not to introduce new "clean" syntax.

Yes, although from my perspective the real problem is that there is a hole
in the language, so the current idiom is something of a temporary
workaround. :) So to me, adding this tiny little new construct like in the
PEP fixes the actual problem, while augmenting the and-or workaround is
like putting duct tape on it. Since we have an opportunity to fix the real
problem, I say let's fix it and fix it right.

> I can understand that you generally dislike the behaviour of current
> and/or expressions not returning bools.  But it's there and it's
> impossible to deprecate it even if we wanted.

I'm not so sure, but even if we couldn't completely eradicate it, is that
a good reason not to make the language right (obviously many people
_don't_ agree that something is missing). IOW, if the language were being
implemented from scratch I'd put in a real conditional operator and
definitely not the and-or thing, so given the chance to do it now the best
course of action seems to do the same thing.

Nice talking to you,
Dave





More information about the Python-list mailing list