Hi, I'm experience strange behavior when I use dicts and triple-quotes strings, for example:
a["b"] = f"""Some really long
long string."""
ends up like this:
a[
"b"
] = f"""Some really long
long string."""
Is it expected behavior or? If yes, how can one disable it?
Operating system: Linux Ubuntu 18.04
Python version: 3.6
Black version: 18.9b0
Does also happen on master: yes
It's a bug. It stems from Black seeing that the right hand side doesn't fit in a line (it doesn't, it's a multiline string!) and tries to split the line by any other means.
In this case, it should recognize that the split made matters worse and abort. But that's not super easy to do at this point. We'll be fixing this though.
Most helpful comment
It's a bug. It stems from Black seeing that the right hand side doesn't fit in a line (it doesn't, it's a multiline string!) and tries to split the line by any other means.
In this case, it should recognize that the split made matters worse and abort. But that's not super easy to do at this point. We'll be fixing this though.