I have four lists like these:
L = [ (1,2), (3,5), (6,10), (7,8) ]
M = [ (1,3), (8,9), (12,13) ]
N = [ (6,10), (3,4), (5,6), (10,11), (12,13) ]
T = [ (6,10) , (1,4) ]
I want to check the presence/absence of every tuple of T inside L, M, and N:
[[True, False, True], [False, False, False]]
The following works but it is incredibly inefficient when the size of T, L, M, and N grows.
[[ y in x for x in [L, M, N] ] for y in T ]
What is the most efficient way to speed up this for large lists?