I use Black for Python, which conforms to PEP8. It removes the indentation from the second line of a two line long value string:
mydict = {
'key0': 'value0',
'key1': 'long-two-lines-string-value1-does-not-fit-in-one-line-has-to-continue'
'value1'
}
to:
mydict = {
'key0': 'value0',
'key1': 'long-two-lines-string-value1-does-not-fit-in-one-line-has-to-continue'
'value1',
}
A colleague questioned this change, and I am wondering if there is any resource/reference that I can use to backup Black's decision to format the code like?
Couldn't find something in PEP8 -- Style Guide for Python Code and The Black code style.
Related, but doesn't answer my question: What is the proper way to format a multi-line dict in Python?
PS: # fmt: off
prevents Black from formatting line, but I don't want to use it, since my team doesn't use Black in general.