Style qeustion: Multiple return values

Chris Angelico rosuav at gmail.com
Mon Apr 12 06:32:11 EDT 2021


On Mon, Apr 12, 2021 at 8:20 PM dn via Python-list
<python-list at python.org> wrote:
>
> On 12/04/2021 20.29, Steve Keller wrote:
> > Just a short style question: When returning multiple return values, do
> > you use parenthesis?
>
> Thus, the answer to your question is a matter of style, and thus the
> understanding of those who might read the code.
>

Yes, just like the subject line says :)

My personal preference: If the purpose is simply to return two values
(which will almost always be unpacked immediately), I would omit the
parens.

ChrisA


More information about the Python-list mailing list