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, 30 Jul 2016 23:36:44 +1000 Lines: 19 Message-ID: References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <579B1ABB.1070500@rece.vub.ac.be> <579c2095$0$22142$c3e8da3$5496439d@news.astraweb.com> <579ca644$0$1589$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de djuNYfY2/RxNxGrJkASK/QpUYBc7YJFHlRMkW3dXqXWg== 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; 'performs': 0.07; 'subject:code': 0.07; 'cc:addr:python-list': 0.09; 'integers': 0.09; 'subject:Why': 0.09; 'python': 0.10; 'language,': 0.11; 'subject:not': 0.11; 'syntax': 0.13; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterable': 0.16; 'iterable,': 0.16; 'iteration.': 0.16; 'mean,': 0.16; 'readability.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'simple.': 0.16; 'subject:allow': 0.16; 'too?': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'body,': 0.22; 'sat,': 0.23; 'header :In-Reply-To:1': 0.24; 'question': 0.27; 'message- id:@mail.gmail.com': 0.27; 'be:': 0.29; 'does,': 0.29; 'improves': 0.29; 'loop,': 0.29; 'rules': 0.31; "can't": 0.32; "d'aprano": 0.33; 'steven': 0.33; 'received:google.com': 0.35; 'could': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'why': 0.39; 'does': 0.39; 'still': 0.40; '30,': 0.63; 'complete': 0.63; 'repeat': 0.67; 'jul': 0.72; 'special': 0.73; "'for'": 0.84; '3.5"': 0.84; 'chrisa': 0.84; 'does?': 0.84; 'to:none': 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=r7k9eY5pgFkvyueIS1k+WmSnecTiKBkcBvPu74nbYUQ=; b=jYa65GP6aV7GSJdmCppTFCXRsUokbr+cguKBObUyVcSnGg9tMJJiX6drl95ePUwK4n o9bPOUg9i3SNuc6n/HxkSCIdAU/4oRG6zkOgXrfPvcBJ8NUoKSuv3nfjxO9RmeIpoFpr bzVzH1tVCsQSvIWQ4uUD5E/8ayMD34lLLKpJrwE1U0BdoeqZJFnItoKH1Q43s/XPIQYG TNU5ZNi/ciRHKf9P22Wy34Ase1pF4k2n0tEJpcHOrkNmrihnv43xmfrNyRvYxa9NwSFY 3ttEap5wH3/0QpGqm44CV0thDbGV9AW4z8Z+MjtlzGVNAMMy1vOKMYs+/gn53iSdXgCp WDMg== 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=r7k9eY5pgFkvyueIS1k+WmSnecTiKBkcBvPu74nbYUQ=; b=MUEwz4IK72Q+teOtFk2fCcZCDYZRK4RyISSmjGuQ5sxoD2rlQNnJzARlhr0XwDD4fY 2Aw4GZj5PgqxWX4nU7hQKCJ6l/kM8P5ccHI7k25kQvnYm3qI1WM3XQdUHHvD2UFFZmm0 /ZzuEqj92iRBun1EFONSbAJSDCEPWaCBP1V95Yx+Aut4CJlVnnGvS9moPagf0SnlZAbQ nnPq/4lA7ITbS2rcLseZg9u83QMymh0F1vnYLiG/V0YPXe2fUsBbCfPwHNdb+NmdnR9s Qq4/9IjmIE6hVXREWIFGP7FXccg9d6iBNQdZ+2zv8sATqKzWNATkHC10d5FYPIUUKUfj u8dA== X-Gm-Message-State: AEkoouvwEpvufCkgu2cyP+EAw0LUVRsT71U6UBakdOq99WBjThHWcQ9/K08x+vVFrVAVoKDODm6e+kfi8rtHOQ== X-Received: by 10.28.221.8 with SMTP id u8mr47409747wmg.61.1469885805987; Sat, 30 Jul 2016 06:36:45 -0700 (PDT) In-Reply-To: <579ca644$0$1589$c3e8da3$5496439d@news.astraweb.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: X-Mailman-Original-References: <5792cd34$0$1587$c3e8da3$5496439d@news.astraweb.com> <87vazwppxx.fsf@elektro.pacujo.net> <579B1ABB.1070500@rece.vub.ac.be> <579c2095$0$22142$c3e8da3$5496439d@news.astraweb.com> <579ca644$0$1589$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:112067 On Sat, Jul 30, 2016 at 11:06 PM, Steven D'Aprano wrote: >> "for i in range(N):" just to repeat a block N times... > > Why should there be special syntax just for repeating a block N times? > There's a general purpose for-loop which performs iteration. Why do you > need special syntax to do what it already does? Python could have chosen to make integers iterable, such that you say: for i in 10: but I don't think it really improves readability. It wouldn't materially damage the language, though - the 'for' loop still does exactly what it does, the rules are still just as simple. The only question would be: why can't floats be iterable too? I mean, "for i in 3.5" should start half way down the loop body, complete that loop, and then do three complete loops. ChrisA