[Python] How to prevent black adding parentheses for chain of code

Discussão em 'Python' iniciado por Stack, Julho 2, 2025.

  1. Stack

    Stack Membro Participativo

    Given code:

    longfunc(long_arg1, long_arg2...).longfunct().longfunct().longfunct()


    How can I prevent black wrapping it in parentheses?

    (
    longfunc(long_arg1, long_arg2...)
    .longfunct()
    .longfunct()
    .longfunct()
    )


    What rule enforces that?

    Continue reading...

Compartilhe esta Página