Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'received:209.85.223': 0.03; 'badly': 0.07; 'extent': 0.07; 'missed': 0.09; 'planned.': 0.09; '"this': 0.13; ':-)': 0.13; '[never': 0.16; 'arg2,': 0.16; 'follow-up': 0.16; 'limit.': 0.16; 'parentheses': 0.16; 'temp': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'variable': 0.20; 'assignment': 0.22; "i've": 0.23; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; 'options': 0.27; '>>>>': 0.29; 'agreed.': 0.29; "d'aprano": 0.29; 'editors': 0.29; 'indentation': 0.29; 'steven': 0.29; 'character': 0.29; 'this.': 0.29; 'e.g.': 0.30; 'window': 0.30; 'handle': 0.33; 'to:addr:python-list': 0.33; 'likely': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'doing': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'really': 0.36; 'except': 0.36; 'but': 0.36; 'characters': 0.36; 'should': 0.36; 'enough': 0.36; 'october': 0.37; 'being': 0.37; 'why': 0.37; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'perform': 0.38; 'comment': 0.38; 'to:addr:python.org': 0.39; 'little': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'skip:u 10': 0.60; 'ever': 0.63; 'more': 0.63; 'exceed': 0.65; 'finally': 0.66; 'act.': 0.84; 'actually,': 0.84; 'bitten': 0.84; 'extra.': 0.84; 'dirty': 0.91; 'hate': 0.93; 'reducing': 0.95 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:content-type :x-gm-message-state; bh=3DHo5JL8HNZY9SxbANbRTfChxp5nQ8nn0F1sIWVOWG4=; b=M1+4vo4/2YSu0SCwK9BvlWU4iiDiidRgLJxq0JeUAbiyDi8yTneTs9hgfxrpalWe/E W3K8WBJZvZJjGh9rZkWP7RaSDxajqj2eOODG8oy13RYOGvmEXEjI3ETg0+x7tn8eK1JN FjIVEA4jLM7NUHypnUiXL/bWB6k8xAyOQlvPU5RBWDH13Er0T/+NrD2lLup8+T2wBP1O ZTjLxHPiuUZ8Hn7HuhiMCBV0QNLwZ8GZ8mpBBUJZoGcdgXhgqTH7oDzx2gT4T5AZW6eT OKhGguyuFFJgRddCFmARm4IxiknO3qtnbvrvVk1CG0hOX7EqvfdhGGnCo/RkCxSI5y8A Kiyg== MIME-Version: 1.0 Sender: z@etiol.net X-Originating-IP: [190.104.26.20] In-Reply-To: <507fa256$0$11093$c3e8da3@news.astraweb.com> References: <507fa256$0$11093$c3e8da3@news.astraweb.com> From: Zero Piraeus Date: Thu, 18 Oct 2012 06:31:50 -0400 X-Google-Sender-Auth: 0sz9NAT9fyCxphe-7DXs6aQUCZs Subject: Re: A desperate lunge for on-topic-ness To: python-list@python.org Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQk/Vp08e3FlSwgJCBGaAIuSE/p3mt22qZ82QpiWkxVTfirag1Tunp0TgG/YzWQ2/hAk1unh X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 63 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350556333 news.xs4all.nl 6923 [2001:888:2000:d::a6]:45432 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31626 : There seems to be a consensus [to the extent there ever is, anyway] around using parentheses etc., then ... On 18 October 2012 02:31, Steven D'Aprano wrote: > I've been burnt enough by word-wrapping in editors that don't handle word- > wrapping that well that it makes me really uncomfortable to go over 78-79 > characters, even by only 1 extra. So I don't like doing this. I have to admit, I try quite hard not to exceed 78. I don't know why [never been bitten by badly behaved editors], but something about 79 characters in an 80-char window makes me uncomfortable. > Just about the only time I go over is if I have a comment that includes a > URL with more than 78 characters. I hate breaking URLs more than I hate > breaking the 79 character limit. Agreed. > You missed one: > > 5a. Perform an assignment to a temp variable that you really should have > done anyway, but reducing the number of characters in the line was the > impetus that finally made you act. Ah. Yes :-) On 18 October 2012 05:33, wrote: > I use a "double indentation". > >>>> if 'asdf' and 'asdf' and 'asdf' \ > ... 'asdf' and 'asdf' and \ > ... 'asdf' and 'asdf': > ... print('do if') > ... s = 'asdf' > ... ss = 'asdf' Actually, I had a follow-up question about indentation planned. I used to double-indent, but am now more likely to go with e.g. >>> if check_something( ... arg1, ... arg2, ... arg3 ... ): ... do_something() as others have suggested. An alternative would be something like >>> if check_something(arg1, ... arg2, ... arg3): ... do_something() which I like much less. I have to admit, though, that all the original options make me feel a little dirty except (#4) "shorter variable names" [which just makes me feel that I am being overly precious] and (#6 generalised) "this needs refactoring" [which I would say includes Steven's #5a]. -[]z.