Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!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 22:22:57 +1000 Lines: 69 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de MUC7gPsRfB1a486V5919dA54NCQpnCAyEW1Wle5/vbZg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'none,': 0.05; 'subject:code': 0.07; 'cc:addr:python-list': 0.09; 'already.': 0.09; 'subject:Why': 0.09; 'python': 0.10; 'subject:not': 0.11; '(at': 0.13; 'syntax': 0.13; '2016': 0.16; '[none,': 0.16; '[that': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'none]': 0.16; 'py3': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'statement.': 0.16; 'subject:allow': 0.16; 'syntaxerror:': 0.16; 'useless': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '"",': 0.22; 'sat,': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.24; 'feature': 0.24; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; 'concise': 0.29; 'print': 0.30; 'code': 0.30; 'aside': 0.32; 'file': 0.34; 'that,': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'instance': 0.35; 'something': 0.35; 'there': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'why': 0.39; 'does': 0.39; 'still': 0.40; 'your': 0.60; 'behavior': 0.61; '30,': 0.63; 'above,': 0.63; 'great': 0.63; 'beat': 0.66; 'jul': 0.72; '10:11': 0.84; '3.5.2': 0.84; 'chrisa': 0.84; 'huh?': 0.84; 'to:none': 0.91; 'spell': 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 :content-transfer-encoding; bh=oKVK7LEHyeMFpC0tk49b36aaTWdRsyY18VYC6s03bRs=; b=NT/13q4Q9LWlBo0frWZBABTihZD0iXb9gWkfBwmgQ8u5UokdK6qbo02fP3vaQd6Pd9 TUDObvwRfaIQFuPdgN0kxAT6UAV6/AbBQ+JHHPZJxUk+L6R89La5ohs2RclwaWI2yxyH 54YYQfx01hiEv01hxmH0VbYsmSMFJNm9hpDTdJXaiatZtr0sYXTHU0zHPc6fpfBBygqO n9iW9AnA5CmjBQHjSGwJ9wVZfr20YOVb8Fg2pb6tZGEP97OCE+qMwO4YOeYnMPPolO9p qyP1AHnUhjFXt7tNJKpcdvItVTBT7uSd8elH1/SdBHcPxk/eMf8JyxsPS91Ea3GrQVpm u6BA== 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:content-transfer-encoding; bh=oKVK7LEHyeMFpC0tk49b36aaTWdRsyY18VYC6s03bRs=; b=JB4g6O+DCi1u/lXiwltFgK8cOzhnLeX+WKjZxsEWJG2JDPIbtxGjJQ+6Kiqkbjoi3D WqeiXa7RN23kCf7az01ck+Kg1wD6bYSuXijseZRTg/0/aUxyASnDlGGlpakFYNJWV7Eu bS7Gcz2zfNnAjDLNV6hCfysI/oDpSlcdpZl7+VYujtQZeAwhOuyvKUc9nUkyCwz3dfuG pEE9T+H60RLJpQrI6NW3YomVUt4yyW47Mjjw5C5DZrFuTFWCKpxVaEBaGY5f6nZ+lwz9 9j4pkYzAoHlm22de6jGktz7gHyMg0nthOtPOyFCPUEHF9vqlA7I31mcgYBp7fKLtRNfa cwYg== X-Gm-Message-State: AEkoouvpTgaOuwebkAKmqixTG9ZPb6I3H9fiKu3Zs6j07zGlhD6DnxGElTkNI5m7lEL54XEahCMXVA97ehylwg== X-Received: by 10.194.114.9 with SMTP id jc9mr42786848wjb.30.1469881379780; Sat, 30 Jul 2016 05:22:59 -0700 (PDT) In-Reply-To: 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> Xref: csiph.com comp.lang.python:112058 On Sat, Jul 30, 2016 at 10:11 PM, Rustom Mody wrote= : >> > - Poorer error catching: What was a straight syntax error is now a lin= t-catch (at best) >> > [print (x) for x in range(20)] >> >> Huh? Aside from the fact that you're constructing a useless list of >> Nones, what's the error? > > Huh=C2=B2 > > Are you seriously suggesting that python-3=E2=80=99s behavior below is be= tter IN > THIS INSTANCE than python-2=E2=80=99s? > > [That there may be other reasons that outweigh this one for print-as-func= tion > is not something I am disputing. I was solely disputing your =E2=80=98jus= t=E2=80=99] > > Python 2.7.12 (default, Jul 1 2016, 15:12:24) >>>> [print(x) for x in range(10)] > File "", line 1 > [print(x) for x in range(10)] > ^ > SyntaxError: invalid syntax >>>> > > Python 3.5.2 (default, Jul 5 2016, 12:43:10) > >>>> [print(x) for x in range(10)] > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > [None, None, None, None, None, None, None, None, None, None] >>>> I still don't understand your complaint. How is this "better/worse error checking"? All you're showing me is the same line of code you showed above, plus what it does in Py2 and Py3, which I know already. You haven't explained why this is such a great feature in Py2 that got lost in Py3. And hey. If you want to print out the numbers 0 through 9, Py3 offers a pretty concise way to spell that: >>> print(*range(10), sep=3D'\n') 0 1 2 3 4 5 6 7 8 9 >>> Beat that, print statement. ChrisA