(PEP-308) Python's Conditional Selection Operators

Gareth McCaughan Gareth.McCaughan at pobox.com
Tue Feb 18 18:48:00 EST 2003


Stephen Horne wrote:

[I said, to Terry Reedy:]
> > However -- and doubtless to you this is a useless quibble --
> > what you said was not "Python's 'and' and 'or' are not the same as
> > those that are standard in logic, math and computer science", but
> > simply "Python's 'and' and 'or' are not the standard versions".
>
>  Myself and Gareth have taken most of our differences to e-mail, but
>  this remains a public attack and so I feel justified in posting a
>  public defence - which is...

No, it isn't an attack at all.

>  Just how much time was Terry supposed to spend carefully excising
>  every possible risk of people reading in judgement from what he said?

Supposed to? However much he likes. Seriously.

>  Is he really to be condemned because, with sufficient effort, it's
>  possible to misinterpret what he said?

No, and I haven't condemned him. At least, I haven't intended to.
It's possible that I've expressed myself badly, in which case
I'm sorry about that. So far as I can see, all I've done is to
disagree with him.

> >Here's
> >an example of how you could have worded what you said so as not to confuse
> >useless quibblers like me.
> >
> >    Python's "and" and "or" operators differ from those that may
> >    be familiar from mathematics, logic or theoretical computer
> >    science, or even from some other languages such as C and C++.
> >    In those domains, "and" and "or" are purely logical operations;
> >    they may perhaps accept non-boolean operands by some sort of
> >    conversion, and may "short-circuit" by not evaluating the
> >    second operand when the first suffices to determine the result,
> >    but they operate on boolean values (true and false), and return
> >    only boolean values.
> >
> >    In Python, as in other dynamically typed languages like
> >    Perl and Smalltalk, these operations are generalized so
> >    that their results are not always boolean. I shall call
> >    them "conditional selection operators", and explain their
> >    unusual properties in the following sections.
>
>  I'm glad you have time to waste carefully filtering every possible
>  misinterpretation - though you missed, of course, the fact that
>  'unusual' is at least as judgemental as 'standard'.

I didn't claim to have filtered every possible misinterpretation,
I *did* explicitly disclaim any suggestion that Terry was in any
sense obliged to write as I did above, "unusual" is not judgemental,
and that word in any case came straight out of what Terry wrote.

>  None of us is perfect, and the English language is certainly not a
>  perfect medium of communication, but in practice it works quite well -
>  IF people accept things for what they are and don't try to pretend
>  that perfection is attainable.

I have never, ever made that pretence.

> > Anyway, Stephen's very wisely taken the discussion to e-mail;
>
>  and is very conscious that his defence has been hidden while the
>  attacks continue in public (not to mention a couple of additions to my
>  inbox which - sorry to those concerned - I won't be replying to. Rest
>  assured that the issues have already been raised in mine and Gareths
>  own, erm, debate - and yes, I have made some mistakes which any lisp
>  programmer whose skills are more current than mine - or perhaps whose
>  memory is perfect - will have spotted).

I don't understand. I have said nothing whatever to or about you
in public since our discussion moved to e-mail, other than the one
sentence fragment quoted above. Nor have I attacked Terry, so far
as I can tell.

Never mind.

-- 
Gareth McCaughan  Gareth.McCaughan at pobox.com
.sig under construc




More information about the Python-list mailing list