On this page
  1. all
  2. Import & Availability
  3. Overview & Signature
  4. Usage
  5. Gotchas
  6. REPL Inspect

all

Prev: aiter | Up: __builtins__ | Next: anext
Rel: any, enumerate, filter, iter, aiter
Ref: docs.python.org — all
Tags: #public #python3 #builtins


Import & Availability

# Built-in (available globally without import)
from builtins import all

Overview & Signature

all(iterable, /)

Return True if bool(x) is True for all values x in the iterable.

Usage

assert all(x > 0 for x in [1, 2, 3]) is True
assert all([True, 0, True]) is False
assert all([]) is True   # vacuous truth on empty iterables!

Gotchas

REPL Inspect

help(all)

Linked from

Related notes