ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH

Reference
ActivePython 2.5
Python Documentation
Library Reference
3. Built-in Types
3.2 Boolean Operations -- and, or, not
2. Writing the Setup Script
2.1 Listing whole packages
2.2 Listing individual modules
2.3 Describing extension modules
2.4 Relationships between Distributions and Packages
2.5 Installing Scripts
2.6 Installing Package Data
2.7 Installing Additional Files
2.8 Additional meta-data
2.9 Debugging the setup script

MyASPN >> Reference >> ActivePython 2.5 >> Python Documentation >> Library Reference >> 3. Built-in Types
ActivePython 2.5 documentation


3.2 Boolean Operations -- and, or, not

These are the Boolean operations, ordered by ascending priority:

Operation Result Notes
x or y if x is false, then y, else x (1)
x and y if x is false, then x, else y (1)
not x if x is false, then True, else False (2)

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.

See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved