long comments cause needless optional parentheses #374
Labels
F: parentheses
Too many parentheses, not enough parentheses, and so on.
T: enhancement
New feature or request
Operating system: Linux
Python version: 3.6
Black version: 18.6b4
Does also happen on master: yes
here's a POC:
reformatted code:
Not sure what is the desired result here, but this is certainly not it :) Probably just leave the line alone in case where the "multilining" doesn't help? There seems to be a behavior where simple assignment is left alone even if too long.
Similar thing happens when the assigned value is long and a relatively short comment pushes it over the edge.
OTOH what I'd actually want in this case is to keep the assignment but push the comment to the next line - or somewhere else. This is the wrong formatting result, but it does notify me that human intervention is needed, which is good.
The text was updated successfully, but these errors were encountered: