Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Marco Sulla Newsgroups: comp.lang.python Subject: Re: Why not allow empty code blocks? Date: Sun, 24 Jul 2016 15:11:21 +0200 Lines: 27 Sender: forwardedby@e4ward.com Message-ID: References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <20160723082947.7cae8bd1@imp> <87fur0a44p.fsf@elektro.pacujo.net> <20160723095441.29562c54@imp> <57939373$0$1586$c3e8da3$5496439d@news.astraweb.com> <5794b1d7$0$1620$c3e8da3$5496439d@news.astraweb.com> Reply-To: mail.python.org@marco.sulla.e4ward.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 3ImZX/LlSrJqi72py3vT9A4FBR+Mm89MYhQ4XpdTlU4A== Return-Path: <4050.gmail.com@bounce.e4ward.com> X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:code': 0.07; 'inserted': 0.09; 'script,': 0.09; 'subject:Why': 0.09; 'tuple': 0.09; 'python': 0.10; 'subject:not': 0.11; '2016': 0.16; 'comma': 0.16; 'loops': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sfxlen:0': 0.16; 'simple.': 0.16; 'sqlalchemy': 0.16; 'subject:allow': 0.16; 'wrote:': 0.16; 'language': 0.19; 'changes': 0.20; 'cc:2**0': 0.20; 'parameter': 0.22; 'cc:no real name:2**0': 0.22; 'errors': 0.23; 'this:': 0.23; 'header:In-Reply- To:1': 0.24; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; "i'm": 0.30; 'error.': 0.31; 'probably': 0.31; 'skip:_ 10': 0.32; 'statement': 0.32; 'maybe': 0.33; 'class': 0.33; 'received:google.com': 0.35; 'header:Received:8': 0.35; 'clear': 0.35; 'fail': 0.35; 'but': 0.36; 'too': 0.36; 'needed': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'received:209.85.220': 0.38; 'easily': 0.39; 'received:192': 0.39; "you'll": 0.61; 'more': 0.63; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'incredibly': 0.76; 'protect': 0.76; 'examples.': 0.84; "it'd": 0.84; 'too:': 0.84; 'worried': 0.84; 'misleading': 0.91 Authentication-Results: atl.e4ward.com (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=e4ward.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e4ward.com; h= reply-to:content-type:content-type:subject:subject:message-id :date:date:from:from:references:in-reply-to:mime-version; s= mail; t=1469365930; x=1469452331; bh=00R20O8RfNBxcjUyH1KkQ0YLmW2 o1vUnAppP1MertTg=; b=fCqMt9FsN9S71UfYMuiR4WMRFi0aSCIOP+jV/m3ZM5t /kYUCm2T+SJFvt+2nsjCvMbLAUvQ4vURUxMbL0yJI7XRxfO5ufsUQ52ntv99MunD yo0J9HyPqp+iWcM+QbBDRzK919cdQzMzSoTliVrCUrT3oIrVksKxTQIGh4jPTiiU = Authentication-Results: atl.e4ward.com (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=00R20O8RfNBxcjUyH1KkQ0YLmW2o1vUnAppP1MertTg=; b=GMrMfQGrNt4Ei6SriZ5pmwgA7bHx+AQuJU/HG6T4Dxpp9nkNPrKteE0vagqQoewoca yFwgni//azEq+ba/5Ej9MdcqLpUcXUR34cjLNAylpDlpt9n9e0UYJ5KHLBhz2gyGOoZF mUV1AXrTpKZOPqs0h/WzxLV6eRrIQTHdmj6WfnDkB1vuWjMYa5OtIf9bu+8+SrHXC0A5 TikejHDtm7UCd4qypEjwBJTckp2672CH0ew5BrkyXoCVWlf9z7r/2kgKxV0dkzlFIe5s 1PWpSUt0yPjq/l3wG4FrzH5rGk8vJCkXgci4sQrRRKRb52TaOetu7M5pTKu6zP17d+e8 1fmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=00R20O8RfNBxcjUyH1KkQ0YLmW2o1vUnAppP1MertTg=; b=ks27lANs1SwL9/DenpmtNV8S+ZFXl6q9LsaBhjUtWpsC3yPLEA7k7AgwVldAUOGCgL BZXEzR+bmYksA+ThpM7YILa2MesegqQYXflDDuBKq95iLo6aYv1gnz7QmiXlfgMPnaKj aIXBw505s/vNAe1iixT7Hwe9yq4XXO4lZkgXCWQj2n2a8DXd6Cp5eTf809XvNuKev9H6 yHmF0oEV2xa//KEwfH6CCi82kQwEMlFhoYBjScuYU0sz1tY/pezpPKOMDW3OhbEFSmTa ncV+01mZExlq5j2XYfQlSHUN+4punKmVp13m8nrLsFLWS5d53JSefa6W2bVtgC6KHTi1 JaBQ== X-Gm-Message-State: AEkoouup983PJAS3oCljtU5mu65OQxM7cVqSRLe/u10E6LygfKuAtMfk9DrUM5eBaxhUsK1jtvo2fT86jIW4gQ== X-Received: by 10.55.215.13 with SMTP id m13mr16015300qki.59.1469365920966; Sun, 24 Jul 2016 06:12:00 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: S_RoKO1dtFP4zADc8N9zMgk-4OQ X-e4ward-RCPT: python-list.python.org-mail.python.org.marco.sulla.e4ward.com@furxh568137.reply.e4ward.com X-e4ward-x: . X-Mailman-Approved-At: Sun, 24 Jul 2016 10:12:34 -0400 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: X-Mailman-Original-References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <20160723082947.7cae8bd1@imp> <87fur0a44p.fsf@elektro.pacujo.net> <20160723095441.29562c54@imp> <57939373$0$1586$c3e8da3$5496439d@news.astraweb.com> <5794b1d7$0$1620$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:111810 On 24 July 2016 at 14:48, Chris Angelico wrote: > Maybe the people who are most worried about this can enact a > simple rule: no dedent without a blank line? That can easily be > verified by a script, and it'd protect against most of the given > examples. It's not too much effort (after any reasonable-sized block > you'll probably have a blank anyway, so it's only the tiniest of loops > that would be affected). And no language changes are needed :) I'm incredibly in favor of such a modification, but maybe this is work for a linter. Honestly, I find the "pass" statement very clear and simple. There's more misleading problems in Python syntax, like this: someFunction( "param1" "param2" # comma missed, there will be only one parameter "param1param2" ) and this one too: class Parent(Base): __tablename__ = 'parent' id = Column(Integer, primary_key=True) children = relationship("Child"), # comma inserted by error. children will be a tuple and SQLAlchemy will fail with misleading errors