GNU Info

Info Node: (python2.1-lib.info)Boolean Operations

(python2.1-lib.info)Boolean Operations


Next: Comparisons Prev: Truth Value Testing Up: Built-in Types
Enter node , (file) or (file)node

Boolean Operations
------------------

These are the Boolean operations, ordered by ascending priority:

Operation                Result                   Notes
------                   -----                    -----
X or Y                   if X is false, then Y,   (1)
                         else X                   
X and Y                  if X is false, then X,   (1)
                         else Y                   
not X                    if X is false, then      (2)
                         `1', else `0'            

Notes:

`(1)'
     These only evaluate their second argument if needed for their
     outcome.

`(2)'
     `not' has a lower priority than non-Boolean operators, so `not A
     == B' is interpreted as `not (A == B)', and `A == not B' is a
     syntax error.


automatically generated by info2www version 1.2.2.9