[issue46167] Parse assert (x == y, "Descriptive text") as statement params instead of a tuple

Serhiy Storchaka report at bugs.python.org
Fri Dec 24 03:44:22 EST 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

For very long expression or very long message you can add parentheses around the expression or message. Black will format it as:

assert (
    very very long
    expression
), (
    "very very long "
    "message"
)

With the proposed feature it will be:

assert (
    very very long
    expression,
    "very very long "
    "message",
)

It saves one line, but the border between an expression and a message is blur. Since they are separated by a comma at the end of line and all lines have the same indentation it looks less readable to me.

Note also that Black adds a comma after message.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46167>
_______________________________________


More information about the Python-bugs-list mailing list