combination of unary and power operator leads to misleading formatting. #646
Labels
F: parentheses
Too many parentheses, not enough parentheses, and so on.
T: enhancement
New feature or request
Operating system:
Ubuntu 18.04.1 LTS
Python version:
Python 3.6.7
Black version:
18.9b0
Does also happen on master: as of 2018-12-20T09:32, yes.
(as per my tweet: https://twitter.com/llanga/status/1075484480436080640 )
The code
blacks to
I think this is misleading because the grammar reduction rules mean that the code actually parses as
-(2**8)
.The result of this code, however you format it, is -256, not 256.
I'm not sure what to suggest. Perhaps not altering the space around
**
?Though I can see that almost any suggestion will be controversial.
The text was updated successfully, but these errors were encountered: