I'm having an odd issue with evaluating a generator expression.
My code has a generator expression that tests a few conditions. Let's call it "gen_ex". If I turn it into a list to see the output:
print(list(gen_ex))
I get this:
[False, False, False, False, True, True, False, False, False]
However, when I use any() and all() on it, I get unexpected results.
any(gen_ex)
return False, while:
all(gen_ex)
returns True.
Should this be the expected behavior? Or is something weird happening behind the scenes?