(PEP-308) Python's Conditional Selection Operators

Erik Max Francis max at alcyone.com
Sat Feb 15 03:34:32 CET 2003


Terry Reedy wrote:

> Python's 'and' and 'or' are not the standard versions:
> 
> In logic, math, and computing science, 'and' and 'or' have well-known
> standard meanings as logical operators, either strict or
> domain-extended via operand coercion, and either conditional in
> execution or not.
> 
> In Python, 'and' and 'or' are generalized as conditional selection
> operators (as explained in following sections), with some unusual
> properties.

You say "standard versions" but there is no such thing in the realm of
computer science.  Python's and/or operators behave just like Lisp's,
for example, and Lisp has been around a very long time.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Man is preceded by forest, followed by desert.
\__/ (graffiti written during French student revolt)
    Computer science / http://www.alcyone.com/max/reference/compsci/
 A computer science reference.




More information about the Python-list mailing list