In the following code I get ([1], [1]) for l1 but ([0], [1]) for l2, l3, l4. Which I find surprising, especially the difference between using t in the in clause (l3, l4), where it makes no difference whether it's a generator comprehension or a list comprehension, vs in the if clause (l1, l2), where it does.
l1 = [(x for x in (0, 1) if x == t) for t in (0, 1)]
l2 = [[x for x in (0, 1) if x == t] for t in (0, 1)]
l3 = [(x for x in [t]) for t in (0, 1)]
l4 = [[x for x in [t]] for t in (0, 1)]
print([(*map(list, l),) for l in (l1, l2, l3, l4)])
May I ask you for a detailed explanation of the rules governing such expressions? A link to relevant documentation? A rationale?