-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12.05.2014 13:47, Christopher Nelson wrote:
> On Sun, May 11, 2014 at 11:00 PM, RjOllos <[email protected]> wrote:
>> I've been wondering if we had a consensus, or could reach one on the
>> following very minor coding style issue. When a tuple is returned in a
>> "return" or "yield" statement, the parenthesis are optional. In the Trac
>> codebase there isn't a consistent pattern of choosing one pattern. I tend to
>> prefer the minimal approach of omitting the parenthesis.
>
> Can you show an example of each style here so we can comment on them?
Consider the following:
def explicit_tuple(invalue):
# Some useless algorithm computing output.
# ...
outvalue1 = 1
outvalue1 = 2
return (outvalue1, outvalue2)
def implicit_tuple(invalue):
# Some useless algorithm computing output.
# ...
outvalue1 = 1
outvalue1 = 2
return outvalue1, outvalue2
As Ryan pointed out, the return value is a tuple in both cases.
Sincerely,
Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
iEYEARECAAYFAlNxDP4ACgkQ31DJeiZFuHfUqQCgwV+SViLu9kjGALjKfZMdmYm9
oX8AoM2Whbcnh+cpjAZP4gAXE1peQDEc
=+rTk
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.