Hacker News new | ask | show | jobs
by saila 1514 days ago
Black doesn't split strings, and I doubt they'd choose to use concatenation if they did.
2 comments

I kind of wish Black would split and join literal strings. I've seen several times when Black converted code like this:

    raise SomeError(
        "Explanation... "
        "yet more explanation"
    )
To this:

    raise SomeError(
        "Explanation... " "yet more explanation"
    )
That just looks odd. Black is fantastic, but not perfect.
Black does split strings if configured and it does use implicit concatenation of Python string literals.
There's an experimental option for splitting long strings using the --preview flag, but it still seems to have some potential issues. That seems like it would be extremely hard to solve correctly.