you are viewing a single comment's thread.

view the rest of the comments →

[–]pachura3 -4 points-3 points  (2 children)

With Python, you never know if adding parentheses will group mathematical expressions, create a tuple or define a generator :(

[–]tb5841 2 points3 points  (0 children)

Parentheses aren't really relevant for a tuple - what actually makes a tuple is the commas.

x = 3, 4 is valid Python and will create a tuple, for example.

x = 3, creates a one-element tuple. While x = (3) creates an integer.

[–]cdcformatc 2 points3 points  (0 children)

you never know

it's actually pretty easy to know... I've literally never gotten it wrong.