Pythonic way of checking if a condition holds for any element of a list
Python has a built in any() function for exactly this purpose.
any():
if any(t < 0 for t in x):
# do something
Also, if you're going to use "True in ...", make it a generator expression so it doesn't take O(n) memory:
if True in (t < 0 for t in x):
Use any()
.
if any(t < 0 for t in x):
# do something