Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '"but': 0.09; 'pep': 0.09; 'pointless': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sentence': 0.09; 'suggest': 0.11; 'slightly': 0.15; '"well,': 0.16; 'pep8': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'temp': 0.16; 'titled': 0.16; 'wrote:': 0.17; "shouldn't": 0.17; 'variable': 0.20; 'preferred': 0.20; 'trying': 0.21; 'assignment': 0.22; "i've": 0.23; 'long,': 0.24; 'specifically': 0.24; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.28; 'header:X -Complaints-To:1': 0.28; 'lines': 0.28; 'consistency': 0.29; "people's": 0.29; 'probably': 0.29; 'from:addr:yahoo.co.uk': 0.32; 'shorter': 0.33; 'zero': 0.33; 'to:addr:python-list': 0.33; 'third': 0.34; 'list': 0.35; 'so,': 0.35; 'sometimes': 0.35; 'received:org': 0.36; 'really': 0.36; 'but': 0.36; 'previous': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'perform': 0.38; 'to:addr:python.org': 0.39; 'little': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'most': 0.61; 'first': 0.61; 'fit.': 0.65; 'realise': 0.65; 'strategies': 0.76; 'it"': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: A desperate lunge for on-topic-ness Date: Thu, 18 Oct 2012 10:12:39 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-92-24-114-159.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 In-Reply-To: X-Antivirus: avast! (VPS 121018-0, 18/10/2012), Outbound message X-Antivirus-Status: Clean 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350551564 news.xs4all.nl 6949 [2001:888:2000:d::a6]:52231 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31612 On 18/10/2012 07:06, Zero Piraeus wrote: > : > > Okay, so, first thing vaguely Python-related that comes to mind [so > probably not even slightly original, but then that's not really the > point]: > > What are people's preferred strategies for dealing with lines that go > over 79 characters? A few I can think of off the bat: > > 1. Say "screw it" and go past 79, PEP8 be damned. > > 2. Say "screw it" and break the line using a backslash. > > 3. Say "well, at least it's not a backslash" and break the line using > parentheses. > > 4. Spend 45 minutes trying to think up shorter [but still sensible] > variable names to make it fit. > > 5. Perform an otherwise pointless assignment to a temp variable on the > previous line to make it fit. > > 6. Realise that if it's that long, it probably shouldn't have been a > list comprehension in the first place. > > Any I've missed? Any preferences? > > -[]z. > I suggest re-reading PEP 8, particularly the section titled "A Foolish Consistency is the Hobgoblin of Little Minds" and specifically the first sentence of the third paragraph "But most importantly: know when to be inconsistent -- sometimes the style guide just doesn't apply." -- Cheers. Mark Lawrence.