No, extra paranas are not needed, and in fact, Parens are always needed for the "Boolean expression" you are testing, see these two simple examples:
In [37]: any(i > 10 for i in range(19))
Out[37]: True
In [38]: all(i > 10 for i in range(19))
Out[38]: False
You have a function call with one argument (an expression for your generator), so there is no need for parsing. See the docs expression expressions for more information .
Levon source
share