On Mon, Apr 12, 2021 at 1:30 AM Steve Keller <keller.st...@gmx.de> wrote:

> 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()
>

I prefer the parens; it's too easy to miss a comma when reading.   The
parentheses make it more clear that you're looking at a tuple.

pycodestyle and pylint don't appear to care one way or the other.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to