[Python] PEP-8 guideline for default parameter

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

  1. Stack

    Stack Membro Participativo

    AFAIK, the default parameters should not have space around the = sign.

    def foo(bar: str="baz")


    What is the convention when there are union types

    def foo(bar: str | None=None)
    def foo(bar: str | None = None)
    def foo(bar: (str | None)=None) # Are parenthesis standard?

    Continue reading...

Compartilhe esta Página