I want to determine if a list contains a certain string, so I use a generator expression, like so:
g = (s for s in myList if s == myString) any(g)
It's "legal", and expressly supported. The general rule is "((x)) is always the same as (x)" (even though (x) is not always the same as x of course,) and it's applied to generator expressions simply for convenience.
((x))
(x)
x