A desperate lunge for on-topic-ness
ckaynor at zindagigames.com
Thu Oct 18 18:58:18 CEST 2012
On Thu, Oct 18, 2012 at 9:47 AM, Dave Angel <d at davea.name> wrote:
> On 10/18/2012 12:26 PM, Chris Angelico wrote:
> > On Fri, Oct 19, 2012 at 3:16 AM, Evan Driscoll <driscoll at cs.wisc.edu>
> >> Python isn't as bad as C++ though (my main other language), where
> >> 80 characters can go by *very* quickly.
> >> 2. Backslash continuations are *terrible*. I hate them with a firery
> >> passion. :-) A line could be 1000 characters long and it would be
> >> better than a 120-character line backslash-continued.
> > I have one mid-sized C++ project at work that's pretty much
> > exclusively under my control. There is precisely ONE place where
> > backslash continuations crop up, and that's long strings that want to
> > be formatted on multiple lines (eg huge SQL statements) - in Python,
> > they'd be trip-quoted. We don't have *any* backslash continuations in
> > Python code.
> But both C++ and Python have automatic concatenation of adjacent
> strings. So you can just start and end each line with a quote, and
> leave off the backslash.
That will work in C++ as the statements won't terminate on new-line (only
on semi-colon), however in Python that won't work as the statement
will terminate at the end of the line. You can get around this by wrapping
the multiple strings inside of parentheses.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list