On 10/05/2016 20:03, DFS wrote:
"There should be one-- and preferably only one --obvious way to do it."
https://www.python.org/dev/peps/pep-0020/
"Explicit is better than implicit."
What is your use case and scenario? :-)
Maybe it's better to write a function to automatise this so that if
i
On Tuesday, May 10, 2016 at 11:03:47 AM UTC-7, DFS wrote:
> "There should be one-- and preferably only one --obvious way to do it."
>
> https://www.python.org/dev/peps/pep-0020/
>
>
Each method of string concatenation has different uses.
> ---
> sSQL = "line 1\
(interspersing letters to name your examples)
On 2016-05-10 14:03, DFS wrote:
A (nope)
> ---
> sSQL = "line 1\n"
> sSQL += "line 2\n"
> sSQL += "line 3"
B (see below)
> ---
> sSQL = ("line 1\n"
> "line 2\n"
> "lin
On Tuesday, May 10, 2016 at 2:03:47 PM UTC-4, DFS wrote:
> Which is the "one obvious way" to do it?
>
> I liked:
>
> sSQL = "line 1\n"
> sSQL += "line 2\n"
> sSQL += "line 3"
>
>
> but it's frowned upon in PEP8.
I would use a way you didn't show:
sSQL = """
line1
line2
"There should be one-- and preferably only one --obvious way to do it."
https://www.python.org/dev/peps/pep-0020/
---
sSQL = "line 1\n"
sSQL += "line 2\n"
sSQL += "line 3"
---
sSQL = ("line 1\n"
"line 2\n"
"line 3"