This is just operator precedence. Your first
(1,) == 1,
groups like so:
((1,) == 1),
so builds a tuple with a single element from the result of comparing the one-element tuple 1, to the integer 1 for equality They’re not equal, so you get the 1-tuple False, for a result.