3 ms·
> foo = ("a very" "long" "string") > is valid python, and so is foo = ("a very", "long", "string") > but they give different results. That's because the form
by Sohcahtoa82 3y ago
> foo = ("a very" "long" "string")
> is valid python, and so is foo = ("a very", "long", "string")
> but they give different results.
That's because the former creates implicit string concatenation, while the latter is 3 distinct strings.
FWIW, while I love Python, I think implicit string concatenation is a huge anti-feature. It is a source of bugs and breaks the Zen of Python which states that explicit is better than implicit.
Your first line should by a syntax error, as far as I'm concerned.