(PEP-308) Python's Conditional Selection Operators

Stephen Horne intentionally at blank.co.uk
Mon Feb 17 16:51:26 EST 2003


On Mon, 17 Feb 2003 10:53:16 +0000, Gareth McCaughan
<Gareth.McCaughan at pobox.com> wrote:

>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...

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

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

>>  Also, I wrote 'standard', not 'Standard' (as in ASCII, ANSI, ISO,
>>  Standard C, etc).  Nor did I hint at the existence of any 'L, M, and
>>  SC Terminology Standards Committee'.  I would prefer that people read,
>>  study, and respond to what I did write rather than criticize what I
>>  intentionally did not write.
>
>I don't know whether that's referring to me, but my article was
>a response to Stephen Horne, not to you. And what I said about
>the ANSI standard in my reply to him was followed (1) by a smiley
>and (2) by a clear acknowledgement that he didn't mean "standard"
>in that sense.

And I can assure you that part was read with a smile, but the wider
implication of much of what was said in this thread is that 'standard'
could not possibly mean 'de facto standard'.

Here, I believe Terry was criticising that general implication in the
thread as a whole - not that one paragraph. I also believe that he is
right.

>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'.

Maybe if you spend a month or two on those two paragraphs, and expand
them out to a few volumes with your careful clarifications, you can
truly remove EVERY possible misinterpretation. Of course then people
will probably read little bits out of context. Oh dear.

And yes, my use of the word 'waste' was a deliberate judgement.

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.

>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).

-- 
steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list