I need to check a very large complete set of binary sequences of length over $2^40$ against a single condition. I am using python. Somehow, I need to iterate through every possible sequence: about a trillion of sequences. Usual python tools (itertools etc.), obviously, won’t do. Maybe someone at least can point me in a right direction on how to implement such big tasks?