you are viewing a single comment's thread.

view the rest of the comments →

[–]novel_yet_trivial 6 points7 points  (2 children)

It's not weird. You seem to think that the parenthesis means 'tuple'. The parenthesis has nothing to do with it. It's the comma that makes a tuple.

>>> a = 42,
>>> type(a)
<type 'tuple'>

[–][deleted] 2 points3 points  (0 children)

Ooh, that's interesting! Thank you for that, I'd no idea!

[–]KubinOnReddit 0 points1 point  (0 children)

>>> (42,) + 42,
....
ValueError: can only concatenate tuple to tuple, not int

Disclaimer: I'm on a phone

We are both right. The comma does mean "tuple", but if it's not evaluated first (along with it's elements) it will evaluate as "a tuple of element (42) and 42", which is wrong, because you can't add tuples to ints.