Closed SerVB closed 3 years ago
QQ before I approve: does this change improve the correctness of arithmetics, or just makes the generated code prettier? No change in box tests coverage, but they may not catch certain cases.
No change in arithmetics here.
Some unneeded parentheses are removed, this shouldn't affect correctness. It's to make code prettier.
Also, I've added optional parentheses to Call, Attribute, and Subscript since in general they can be needed there. For example, sometimes we need to calculate 2 + 2
and then call a method like .__add__(2)
. With this PR, it will be generated properly: (2 + 2).__add__(2)
. I hope this prevents some bugs in the future.
Well, this is only a cosmetic change so not much changed there, but as it's ready, I propose to merge it. I will do integers support in future PRs.