You can think of the choice ( | ) as a generator function.
X generates 1 then 2.
Y generates 7 then 8.
For x in [1,2]: For y in [7,8]: yield (x, y)
For x in [1,2]: For y in [7,8]: yield (x, y)
[(x, y) for x in [1, 2] for y in [7, 8]] // Python (list comprehension)
{(x, y) | x \in {1, 2}, y \in {7, 8}} // math (set-builder notation)