DEV Community

Discussion on: Analyzing python iterables with all() and any()

Collapse
 
dbanty profile image
Dylan Anthony

Nice post! Worth that they will short circuit. Meaning all will return as soon as it sees a False and any will exit as soon as it sees True.

So if you’re going to have a bunch of calculated values you should use a generator of some sort rather than building the list in advance.