Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'argument': 0.05; 'received:134': 0.05; 'subject:Python': 0.06; 'assignment': 0.07; 'preference': 0.07; 'bug.': 0.09; 'converts': 0.09; 'python': 0.11; 'bug': 0.12; 'braces': 0.16; 'code?': 0.16; 'delimiter': 0.16; 'example).': 0.16; 'losing': 0.16; 'optional': 0.16; 'pressing': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'thu,': 0.19; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; "doesn't": 0.30; 'see,': 0.30; 'gives': 0.31; 'code': 0.31; '>>>>': 0.31; 'accidentally': 0.31; "d'aprano": 0.31; 'indentation': 0.31; 'steven': 0.31; 'bugs': 0.33; 'problem': 0.35; 'subject: (': 0.35; 'there': 0.35; 'possible': 0.36; 'subject:New': 0.37; 'wrong': 0.37; 'so,': 0.37; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'expression': 0.60; 'up,': 0.60; 'protection': 0.63; 'kind': 0.63; 'happen': 0.63; 'more': 0.64; 'different': 0.65; 'yourself': 0.78; 'protect': 0.79; '2015': 0.84; 'pardon': 0.84; 'protects': 0.84; 'absolutely': 0.87; 'mistakenly': 0.91; 'mistakes': 0.93; 'wishing': 0.93 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYEAAjUMFWGuA9G/2dsb2JhbABdh1HHeoJcAoIdAQEBAQEBhR8BAQQjZgsYAgIFIQICDwJGEwgCiCayUZBGhGkBAQgCIIEhigiFAxaCUoFFBZtAgR2Fc4osg04ig3GDMAEBAQ Date: Fri, 17 Apr 2015 11:37:54 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: New to Python - block grouping (spaces) References: <9fc57fc9-0399-4ff3-882a-d041f02827d8@googlegroups.com> <552f4d67$0$2907$c3e8da3$76491128@news.astraweb.com> <552fecea$0$13006$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <552fecea$0$13006$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1429263487 news.xs4all.nl 2962 [2001:888:2000:d::a6]:34201 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:89058 Op 16-04-15 om 19:10 schreef Steven D'Aprano: > On Thu, 16 Apr 2015 08:51 pm, BartC wrote: > >> On 16/04/2015 06:49, Steven D'Aprano wrote: >>> On Thursday 16 April 2015 14:07, Blake McBride wrote: >>>> Is there a utility that will allow me to write Python-like code that >>>> includes some block delimiter that I can see, that converts the code >>>> into >>>> runnable Python code? If so, where can I find it? >>> No more bugs from accidentally forgetting to use optional braces! >> You get bugs instead from mistakenly using the wrong indentation or >> losing the correct indentation (accidentally pressing the wrong key for >> example). > That's nothing! Python gives you absolutely no protection from accidentally > typing: > > > x += 1 > > when you actually wanted: > > y -= 2 I find this a bit disingenuous. Each time assignment as an expression comes up, so that it would be possible to have an assignment in a if or while condition, few of the regulars seem to have a problem with the argument that the current choice protects against a particular kind of bug. The fact that braces protect against a kind of bug you care less about, is just your preference. That doesn't mean a different preference is somehow worthy of ridicule. Mistakes of all kinds happen and I see no reason to ridicule someone for wishing protect against one kind of mistake, while yourself having the protection you like. -- Antoon Pardon