Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: Guido sees the light: PEP 8 updated Date: Tue, 19 Apr 2016 10:05:48 -0400 Lines: 56 Message-ID: References: <5711c1b3$0$1596$c3e8da3$5496439d@news.astraweb.com> <87shym6kpo.fsf@elektro.pacujo.net> <87h9f26ioa.fsf@elektro.pacujo.net> <1460809922.1918014.580580553.0AE05EE4@webmail.messagingengine.com> <878u0d7az5.fsf@elektro.pacujo.net> <93639142-6b82-4b8a-8bd0-7f4593e1f692@googlegroups.com> <1461036589.1221872.582808913.08A50F70@webmail.messagingengine.com> <8b3aa2c6-4314-446a-a894-fe61451a373a@googlegroups.com> <1461039063.1234620.582832393.7B6F72B6@webmail.messagingengine.com> <0536e5a3-793f-44b3-87cc-5743bcf2a6a9@googlegroups.com> <1461074748.2551319.583266185.15F4C348@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de U98v+NEIODezEDm/JGXkVQW2a7sdgI4DzKp5tRz8OK+g== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:PEP': 0.07; '"("': 0.09; '###': 0.09; 'received:internal': 0.09; 'tab': 0.09; '"some': 0.16; 'line)': 0.16; 'margin': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'sed': 0.16; 'wrote:': 0.16; '(the': 0.22; 'this:': 0.23; 'header :In-Reply-To:1': 0.24; 'block,': 0.29; 'multiline': 0.29; 'code': 0.30; 'becomes': 0.30; 'push': 0.30; 'another': 0.32; 'maybe': 0.33; 'problem': 0.33; 'source': 0.33; 'third': 0.33; 'displayed': 0.33; 'foo': 0.33; 'instead,': 0.33; 'tue,': 0.34; 'file': 0.34; 'could': 0.35; 'acceptable': 0.35; 'displays': 0.35; 'quite': 0.35; 'something': 0.35; 'comment': 0.35; 'but': 0.36; 'there': 0.36; 'lines': 0.36; '(and': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'really': 0.37; 'starting': 0.37; 'no,': 0.38; 'received:66': 0.38; 'stuff': 0.38; 'means': 0.39; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'header:Message-Id:1': 0.61; 'further': 0.62; 'between': 0.65; 'sit': 0.66; 'as:': 0.79; 'bar:': 0.84; 'hanging': 0.84; 'longer?': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=mNhQs/4y8ppd5FqBkalW4xJl1Ns=; b=ocf27g ogpDBkPj42JqS+hR3KMXgqUqlg0nK7HhBm/T495CWuvFuJKNgc6qhojp5wSzVEW8 vwhRODCOM/+0wOteu9ZpPmwe3aIj3B6j74FS1MTc2Tmx+zY2w/aQhVuij3lsGuYF W8CGz60kogcdq+mPVVjpRWUBVtRqmAVGgWpiI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=mNhQs/4y8ppd5Fq BkalW4xJl1Ns=; b=E61wL7Y9btZPBnhpHEGSpUO+wmeGzmQFhFsBEyyh5FOYqOD Kb6V8dX3Kfz2aHi4kIs2Qs3jRSDbEM+KDRWP6VOwsNfCRog3sa1OFCy6rbEshIxh LjTukqn8uCAIP0+EUEh4/GNPf2S2OSZ5U8cbraieVPiVS/y8Vtaa7uU+B3hE= X-Sasl-Enc: QmNcd/iD9Xa1yCJM6TXTgOlA/tDEvqz6ayvnoQphNHup 1461074748 X-Mailer: MessagingEngine.com Webmail Interface - ajax-9b739787 In-Reply-To: <0536e5a3-793f-44b3-87cc-5743bcf2a6a9@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1461074748.2551319.583266185.15F4C348@webmail.messagingengine.com> X-Mailman-Original-References: <5711c1b3$0$1596$c3e8da3$5496439d@news.astraweb.com> <87shym6kpo.fsf@elektro.pacujo.net> <87h9f26ioa.fsf@elektro.pacujo.net> <1460809922.1918014.580580553.0AE05EE4@webmail.messagingengine.com> <878u0d7az5.fsf@elektro.pacujo.net> <93639142-6b82-4b8a-8bd0-7f4593e1f692@googlegroups.com> <1461036589.1221872.582808913.08A50F70@webmail.messagingengine.com> <8b3aa2c6-4314-446a-a894-fe61451a373a@googlegroups.com> <1461039063.1234620.582832393.7B6F72B6@webmail.messagingengine.com> <0536e5a3-793f-44b3-87cc-5743bcf2a6a9@googlegroups.com> Xref: csiph.com comp.lang.python:107327 On Tue, Apr 19, 2016, at 08:55, Rustom Mody wrote: > > Like, it ends up looking like this: > > > > if foo("what if it's a much longer condition"): # comment > > do something # > > comment2 > > > > There's no way to get this: > > > > if foo("what if it's a much longer condition"): # comment > > do something # comment2 > > I get it looking quite nice if I put a tab between "foo" and "(" > Is that an acceptable solution?? Dunno... No, because what if "foo" is much longer? You could put a tab after "if", but that means while-blocks are indented further than if-blocks. And that just delays the problem to the third indent block, you've got to find something to line that up to. if foo("blah blah blah"): # comment if bar("etc etc etc etc"): # comment do stuff # comment becomes if foo ("blah blah blah"): # comment if bar ("etc etc etc etc"): # comment do stuff # comment Maybe what we really need is a way to _display_ a multiline comment at the right margin (and hanging down for as many lines as it needs), without having it baked into the source code that way. Source file contains: ### Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ### ut mattis leo. In sed arcu gravida, consequat tellus placerat, ### ullamcorper metus. if foo: if bar: do stuff ### some other stuff (the last ### is just an empty comment to push stuff after it down past the first comment - if another comment is there instead, it will be displayed starting from the "some other stuff" line) Displays as: if foo: # Lorem ipsum dolor sit amet, consectetur if bar: # adipiscing elit. Etiam ut mattis leo. In sed do stuff # arcu gravida, consequat tellus # placerat, ullamcorper metus. some other stuff