bool_operations.rst 373 B

123456789101112131415161718192021222324252627
  1. .. _bool-ops:
  2. Native boolean operations
  3. =========================
  4. Operations on ``bool`` values that are listed here have fast,
  5. optimized implementations.
  6. Construction
  7. ------------
  8. * ``True``
  9. * ``False``
  10. * ``bool(obj)``
  11. Operators
  12. ---------
  13. * ``b1 and b2``
  14. * ``b1 or b2``
  15. * ``not b``
  16. Functions
  17. ---------
  18. * ``any(expr for ... in ...)``
  19. * ``all(expr for ... in ...)``