0

我想记录一个外部函数:

strange_function(
    # Comments about what this argument does
    param_1=True,

    # Comments about what this argument does
    param_2=False,
)

Black 将其重新格式化为:

strange_function(
    # Comments about what this argument does
    param_1=True,
    # Comments about what this argument does
    param_2=False,
)

想要和之间的新行param_1param_2因为这样评论更具可读性。但是黑色消除了这一点。它如何阻止它这样做?

4

1 回答 1

0

你不能。

黑色非常无情,只给你一个旋钮:每行允许多少个字符。

于 2021-02-10T10:35:01.607 回答