Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Why not allow empty code blocks? Date: Sat, 23 Jul 2016 21:34:49 +1000 Lines: 14 Message-ID: References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de zSIfO5VtqZzTnf+VnI8M4gF8axZg/GG7M4KGApvkU9Gg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'that?': 0.05; 'subject:code': 0.07; 'cc:addr:python-list': 0.09; 'subject:Why': 0.09; 'subject:not': 0.11; '2016': 0.16; '23,': 0.16; '9:13': 0.16; 'dummy': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'statement.': 0.16; 'statements,': 0.16; 'stuff,': 0.16; 'subject:allow': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'pass': 0.22; 'sat,': 0.23; 'header :In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'block,': 0.29; 'optional.': 0.29; 'code': 0.30; 'possibly': 0.32; 'statement': 0.32; 'received:google.com': 0.35; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'requirement': 0.37; 'rather': 0.39; 'where': 0.40; 'here.': 0.62; 'statement,': 0.66; 'jul': 0.72; 'actually,': 0.84; 'chrisa': 0.84; 'to:none': 0.91; 'urge': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=H5pfc507G5ZRHI4Hd4vZM8YibhOf+cNr/JbuNpRDi8A=; b=x1wHkKlk8xFVde3i6Bh9r5FuVS70Kl68kFrvw8TWJFM1+Dnalr/NJ6lTiGwEl991r7 jtOBG0MUNDJP8G0Hqc8lUmPngGdCRoTXM6dyfCs8Adu3MsPbqb44QHl9oRnnEQ2coEDl 7GRecHlIA+wMUkVQb/tTh3yMYGnXB1FLCwFo0u/kljSIHjnnpPVk4MU7tXM3k43+vYZ5 +ZKnLO6L5Jv2amalnf8GY/AOJ1aufjxtw6wrCeqpWqe4SfhtdA4yseqd+c8p2SnWy5AH Tv4qQy2ZTnr7FVUXol/hz39tb3vnBvi3ckJahd7MpGKMP1iUynGlWn3e30hleTn49Q+d xOGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=H5pfc507G5ZRHI4Hd4vZM8YibhOf+cNr/JbuNpRDi8A=; b=hyLVWNKGiRKEaANIzkxYtd+ZTtm8FxOsh9yZ9yQhqL7fW4vgQp7Jhu/TsqM+ObAZvZ f/u357X7w6xEsV9bI2ThKcjuhHpYqWHZt1ZFUZj9HfvqEKGshRLxTNZ9tZRcuUn5neUW OKUEhatfZ/UP3Dsb/D7zcrTzOzMN6u/kZyIE6hO10cnCQfluojFofSFJ4AKdDWRB+BjW DttO2iYCW5/Lwmmlzu742knxq+DIh6jwQUnnF9IDekqymcE5Ws6m6td3MC5eHg4KwnDz pC4Zm/m2v/aAlAe+ey8A5rprbOgmCGPNDb2QPibcMSVC0HOxWDBgT6U+sHldHu7o5cFk wlvQ== X-Gm-Message-State: ALyK8tJCOXo9ut5PK+DBi3r3SdS41R5YAkUcd9ZypvZpmyeo+2wkit6kQ3e+vRiPk+D+PDIeAF371fg6zQChdg== X-Received: by 10.28.50.199 with SMTP id y190mr29489676wmy.61.1469273689947; Sat, 23 Jul 2016 04:34:49 -0700 (PDT) In-Reply-To: <87vazwppxx.fsf@elektro.pacujo.net> 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> Xref: csiph.com comp.lang.python:111783 On Sat, Jul 23, 2016 at 9:13 PM, Marko Rauhamaa wrote: >> One less thing to be programmed, one less thing for the user to >> remember. Just require pass any time you have an empty block, rather >> than try to remember where it is required and were it is optional. > > Actually, the requirement of a dummy statement is a slight annoyance for > the programmer. After deleting a statement, you must see if you have to > put in a pass statement. And after adding a statement, you may feel the > urge to remove the redundant pass statement. How often do you actually need empty statements, adding stuff, removing stuff, like that? Possibly there's a code smell here. ChrisA