Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: for / while else doesn't make sense Date: Sat, 21 May 2016 20:08:21 +1000 Lines: 37 Message-ID: References: <573dfc0f$0$1586$c3e8da3$5496439d@news.astraweb.com> <573e54f7$0$1615$c3e8da3$5496439d@news.astraweb.com> <573FA496.5050708@stoneleaf.us> <573fdaf9$0$1584$c3e8da3$5496439d@news.astraweb.com> <574030d3$0$1598$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de cqZfTZ90U0DXZhW395lMGwo2yYWhwFnBEVxvoum2/pRg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'cpython': 0.05; '21,': 0.07; 'cc:addr:python-list': 0.09; 'expected.': 0.09; 'happens.': 0.09; 'implies': 0.09; 'subject:while': 0.09; 'bug': 0.10; 'example:': 0.10; 'python': 0.10; '2016': 0.16; '``pass``': 0.16; 'call?': 0.16; 'executed,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'placeholder': 0.16; 'received:74.125.82.46': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:make': 0.16; 'world!")': 0.16; 'wrote:': 0.16; 'case.': 0.18; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'meant': 0.22; 'bug?': 0.22; 'pass': 0.22; 'sat,': 0.23; 'second': 0.24; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; '---': 0.28; 'there.': 0.30; 'print': 0.30; 'code': 0.30; 'certainly': 0.30; 'query': 0.30; "i'd": 0.31; 'statement': 0.32; 'useful': 0.33; "d'aprano": 0.33; 'null': 0.33; 'steven': 0.33; 'surely': 0.33; 'received:google.com': 0.35; 'nothing.': 0.35; 'something': 0.35; 'received:74.125.82': 0.35; "isn't": 0.35; 'according': 0.36; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'someone': 0.38; 'why': 0.39; 'does': 0.39; 'your': 0.60; 'subject: / ': 0.63; 'here:': 0.63; 'chrisa': 0.84; 'me;': 0.84; 'subject:else': 0.84; 'subject:sense': 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:date:message-id:subject:from:cc; bh=Cs3hjfXaoH0nFour+DsZsP25cXJ3XvQ4MrAG6o4vBOc=; b=fRLMwHD/6f908G6P8jn4gsJ4lPeIdO1KeOVmrJzRhZ7PH4eblnZ1Xinq1e2wRIgumT JcQX7QLUpdM5rTGajLjCZ8p7d4CvxgJ1jPS6ejZqHLuoBuMe31Wu9Gwwa6Qtgux5MEbG OVCzxXxnzN2YZ0XWlHJ0BlKPYeciVjAJkWPrRvJMw4YGGfovGD6f1EqtNr2LA2gG7DkY Au2TFo1jUu0lQH0twDb8v7H/+ZEHpOPlLbV0iYQ8LLr6+pXcS1hck2gUnHYDg9TM/J1l Piz9RwuBHHSUV6i0IE6bzYL0fvQQ6uRfp6Z3DV7kAwHp1uzVmL+Tqpp0oD+25N/I+4Ib 0zKA== 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:date :message-id:subject:from:cc; bh=Cs3hjfXaoH0nFour+DsZsP25cXJ3XvQ4MrAG6o4vBOc=; b=lnF7FRdtJV/2dFRxyyZWVKOD/yuXewz5GSwYXxE+cA+uI+xOiUgqHZBbErRmCzhwx5 9yj9Kwnr2iEq7RIVP0RtItW7tkkNQtXCIcYkM8bbiZU6Yp7j5LDLRKMznSOS+uC80+N4 2wpEyFu7l//XrjYHKHssKbh2JkO/5L3EX3y+2QRs8mG7zk7ksBJyvvMfu3yD/eROnVOy rWlmTcO0IKetBjNpJVWJCTptQ7tT53usUSj0qomBppWQFqoqpE9l7hlY1qDCh7gR8xS+ KTp86jKPt1ef4EyVyKlSGp1D7Akug7qM1fGddamFrMvWUjGyH5Q0QJa2qOBFBUwY1Ekj ecSw== X-Gm-Message-State: AOPr4FWWvrBJc1e4Zh28dtysUn/S6gcyaY8giAP2h5n0VUjOWecJvrFrP1ZeEKpvXJuzyc88ECSi1j7SwYLmmQ== X-Received: by 10.194.110.234 with SMTP id id10mr7379937wjb.30.1463825301873; Sat, 21 May 2016 03:08:21 -0700 (PDT) In-Reply-To: <574030d3$0$1598$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: <573dfc0f$0$1586$c3e8da3$5496439d@news.astraweb.com> <573e54f7$0$1615$c3e8da3$5496439d@news.astraweb.com> <573FA496.5050708@stoneleaf.us> <573fdaf9$0$1584$c3e8da3$5496439d@news.astraweb.com> <574030d3$0$1598$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:108911 On Sat, May 21, 2016 at 7:56 PM, Steven D'Aprano wrote: > On Sat, 21 May 2016 02:01 pm, Chris Angelico wrote: > >> On Sat, May 21, 2016 at 1:50 PM, Steven D'Aprano >> wrote: > >>> Would you classify the second line here: >>> >>> print("Hello World!") >>> pass >>> >>> >>> as a bug? What exactly would your bug report be? "pass statement does >>> nothing, as expected. It should do nothing. Please fix." >>> >> >> Yes, I would. It's not a bug in Python or CPython - it's a bug in the >> second line of code there. It implies something that isn't the case. > > What do you think it implies? > > What part of the docs for "pass" implies this thing? > > help("pass"): > > ``pass`` is a null operation --- when it is executed, nothing > happens. It is useful as a placeholder when a statement is > required syntactically, but no code needs to be executed, for > example: [examples snipped] So why is a statement required syntactically after that print call? Surely that implies something about the programmer's intent? It certainly isn't required according to the code you've shown me; and if someone submitted this code to me, I'd query it ("was there something else meant to be here?"). ChrisA