Hacker News new | ask | show | jobs
by EE84M3i 570 days ago
Is it common to use parenthesis for python assert statements?
1 comments

I would say no. In fact it is risky, because if you try to add an assertion message inside the parens you’re now asserting a non-empty tuple which is always truthy. Though obviously you might know enough to not make this error, and want the parens for consistency when asserts need to be multiline.

tratt might also be doing that more for consistency with the desugaring than as a routine behaviour.