From docs , all equivalent to:
def all(iterable): for element in iterable: if not element: return False return True
Then why do I get this conclusion:
# expecting: False $ python -c "print( all( (isinstance('foo', int), int('foo')) ) )" Traceback (most recent call last): File "<string>", line 1, in <module> ValueError: invalid literal for int() with base 10: 'foo'
When:
# expecting: False $ python -c "print( isinstance('foo', int) )" False
source share