Is the shortcircuit behaviour of Python’s any/all explicit?

The behaviour is guaranteed. I’ve contributed a patch, which was accepted and merged recently, so if you grab the latest sources you will see that the short-circuiting behaviour is now explicitly enforced.

git clone https://github.com/python/cpython.git
grep Short-circuit cpython/Lib/test/test_builtin.py

Leave a Comment