Ben Finney <[EMAIL PROTECTED]> wrote:

> Tony Nelson <[EMAIL PROTECTED]> wrote:
> > While we're at it, I use bracketing instead of line continuation:
> > 
> >     print ( "a long string, longer than this "
> >             "and some more of the string" )
> 
> To continue the pedantry: Those are parentheses, not brackets.
> 
> Slightly more on-topic, the parentheses make it look like a sequence
> to this reader (though, without a comma, not to the Python parser, of
> course).

Nevertheless, my favorite style has also always been to use parentheses,
and I was glad to see, on joining Google and studying its in-house
Python style guide, that Google mandates that style, too.  After all,
though they're overloaded, it's _commas_ that make a tuple, not
parentheses, which essentially just *group* things (in cases where the
language's syntax would otherwise not suit you).  So, you always do have
to watch out for commas, ayway, since, e.g.,

x = "Sempre caro", "mi fu"

and

x = "Sempre caro mi fu"

are so different -- it makes no difference whether either or both of
these assigments use parentheses (after the = and at line end), it's the
comma that does make all the difference.  So, you can see it as a very
good side effect of the "long string use parentheses, not backslashes"
style rule, that the reader is soon weaned of the mistake of believing
that parentheses signify tuples.


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to