Style qeustion: Multiple return values

Steve Keller keller.steve at gmx.de
Mon Apr 12 04:29:30 EDT 2021


Just a short style question: When returning multiple return values, do
you use parenthesis?

E.g. would you write

    def foo():
        return 1, 2

    a, b = foo()

or do you prefer

    def foo():
        return (1, 2)

    (a, b) = foo()


Steve


More information about the Python-list mailing list