On this page
article
Tip #88: Use any/all for boolean checks on iterables
Python tip #88: Use any/all for boolean checks on iterables.
Tip
Use any/all for boolean checks on iterables
Why
Following this practice makes your Python code more readable, maintainable, and less error-prone.
Example
# Before (avoid)
# ... less idiomatic approach ...
# After (prefer)
# ... idiomatic Python 3.10+ approach ...