Hacker News new | ask | show | jobs
by jldugger 1517 days ago
I wonder if an autoformatter like black is at play here.
2 comments

Black doesn't split strings, and I doubt they'd choose to use concatenation if they did.
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.
Black doesn't change the semantics of code.