[Python] Python indentation in "empty lines"

Discussão em 'Python' iniciado por Stack, Setembro 3, 2025.

  1. Stack

    Stack Membro Participativo

    Which is preferred ("." indicating whitespace)?

    A)

    def foo():
    x = 1
    y = 2
    ....
    if True:
    bar()


    B)

    def foo():
    x = 1
    y = 2

    if True:
    bar()


    My intuition would be B (that's also what Vim does for me), but I see people using A) all the time. Is it just because most of the editors out there are broken?

    Continue reading...

Compartilhe esta Página