Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31665

Re: A desperate lunge for on-topic-ness

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'newline': 0.07; 'strings.': 0.07; 'trailing': 0.07; 'python': 0.09; 'backslash': 0.09; 'formatted': 0.09; 'naturally': 0.09; 'cc:addr :python-list': 0.10; ':-)': 0.13; '*any*': 0.16; 'adjacent': 0.16; 'backslash,': 0.16; 'crop': 0.16; 'driscoll': 0.16; 'next.': 0.16; 'oct': 0.16; 'similarly,': 0.16; 'wrote:': 0.17; 'code.': 0.20; 'visible': 0.22; 'cc:2**0': 0.23; 'statement': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'leave': 0.26; 'am,': 0.27; 'wonder': 0.27; 'c++': 0.27; "doesn't": 0.28; 'lines': 0.28; 'went': 0.28; 'chris': 0.28; '(my': 0.29; 'accidentally': 0.29; 'whitespace': 0.29; 'handled': 0.29; 'fri,': 0.30; 'could': 0.32; 'agree': 0.34; 'skip:b 20': 0.34; 'project': 0.34; 'problem,': 0.35; 'pm,': 0.35; 'continue': 0.35; 'there': 0.35; 'but': 0.36; 'characters': 0.36; 'bad': 0.37; 'editor': 0.37; 'subject:: ': 0.38; 'received:192': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'subject:-': 0.40; 'end': 0.40; 'your': 0.60; 'header:Reply- To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'quote,': 0.84; 'received:74.208.4.194': 0.84; "they'd": 0.84; 'hate': 0.93
Date Thu, 18 Oct 2012 12:47:48 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
MIME-Version 1.0
To Chris Angelico <rosuav@gmail.com>
Subject Re: A desperate lunge for on-topic-ness
References <CANaSqUfLX7V2OxhO+fdVtmQcDzNfEgQfutHak_G-9_1_4nNr1Q@mail.gmail.com> <50802B5B.6040902@cs.wisc.edu> <CAPTjJmqGmYHD7vTdWdSq-Ro4ZCv2z=3zea92iahy-7Qx4=NoOg@mail.gmail.com>
In-Reply-To <CAPTjJmqGmYHD7vTdWdSq-Ro4ZCv2z=3zea92iahy-7Qx4=NoOg@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:iPzweNE78IrSgZSgjqNjnBuc7Xqzfnkcv8SCXB+b3Si RWN7pAAqAXTmv1JNO5lWmrhYyTE0XGbxKPtQitOFJkMpmpd4Ov lOLKF3Lm8VwapcK/J0pXQKZvQCCe9oSL3KddsmJMnZ9sOr10uo AbrPRvS9aRibNNzl6jGiPAgRpy9cpPa5my6MnmadmfTmTmvv5l tP8V0C3cw53wLw/f+mL2NWaLZFW6rp+XJrO1BaXTPOM20RaHLw FoYZVQiRfWvq5LEPuOdMjmtZGOD8RdH0+qvDDK4jAJe3yAta3x KEdDzPi2BAAmczp9KrIYsP1SNUGJBK+N4u1dlmPzujuoyRIfQ= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2454.1350578890.27098.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1350578890 news.xs4all.nl 6989 [2001:888:2000:d::a6]:59196
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31665

Show key headers only | View raw


On 10/18/2012 12:26 PM, Chris Angelico wrote:
> On Fri, Oct 19, 2012 at 3:16 AM, Evan Driscoll <driscoll@cs.wisc.edu> wrote:
>>    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.

Similarly, if you need a newline at the end of each line, you can use
the \n just before the trailing quote.  Naturally I agree with you that
this case is better handled in Python with triple-quote.

I never use the backslash at end-of-line to continue a statement to the
next.  Not only is it a readability problem, but if your editor doesn't
have visible spaces, you can accidentally have whitespace after the
backslash, and wonder what went wrong.

-- 

DaveA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: A desperate lunge for on-topic-ness Dave Angel <d@davea.name> - 2012-10-18 12:47 -0400
  Re: A desperate lunge for on-topic-ness Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-19 01:20 +0000
    Re: A desperate lunge for on-topic-ness Dave Angel <d@davea.name> - 2012-10-18 22:00 -0400

csiph-web