L
lallous
Hello
Maybe that's already documented, but it seems the parser accepts to
build a long string w/o really using the first method:
# Method1
x = "line1" + \ # cannot use comments!
"line2"+ \
"line3"
and instead using a list with one element like this:
# Method2
x = [
"line1" # can use comments
"line2"
"line3"
][0]
Or:
# Method3
x = (
"line1" # can use comments
"line2"
"line3"
)
(Not that I don't want new lines in the strings)
Now should I be using method 2 or 3 in production code?
Maybe that's already documented, but it seems the parser accepts to
build a long string w/o really using the first method:
# Method1
x = "line1" + \ # cannot use comments!
"line2"+ \
"line3"
and instead using a list with one element like this:
# Method2
x = [
"line1" # can use comments
"line2"
"line3"
][0]
Or:
# Method3
x = (
"line1" # can use comments
"line2"
"line3"
)
(Not that I don't want new lines in the strings)
Now should I be using method 2 or 3 in production code?