I don’t think that’s true.
The entire point of d-strings is that they make it easier to work with text blocks inside indented python code by changing the indentation logic, so it’s specifically, deliberately inconsistent with the other string types.
I think the important points to consider when thinking about the indentation are not if they are consistent, but
- How easy it is to read indented blocks inside already indented python code
- How easy it is to write blocks of text in already indented python code
- How easy it is to compose together these blocks of text
What your answers are determine where/how you think d-string should indent the text.
I think having to put a \ at the start of practically every d-string is just inviting bugs from the 1/N chance people forgetting to add and not noticing because it “look right”. I expect N~50. Having to remember doing this will make it harder to write, and having to notice the \ or lack thereof will make it harder to read correctly.
Honestly, I almost never see a \ line break in python code, especially “good” python code. I personally find it extremely distasteful. The PEP 8 style guide also discourage its use, allowing it only as “last resort”
The preferred way of wrapping long lines is by using Python’s implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation.
Backslashes may still be appropriate at times. For example, long, multiple with-statements could not use implicit continuation before Python 3.10, so backslashes were acceptable for that case:
So I think for most python programmer using \ will feel very foreign.
If that is the case, I believe solutions that involve having to add extra indentation deliberately will be always be more natural, clear, and obvious then solutions that require using \ to remove indentation.