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 22:44:58 +1000 Lines: 26 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> <72e60c1c-801a-4a39-a13f-ba8e25d4e870@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de NetZwGXz0norqKbqMom8RwCtQGGMe/TEVQel6YgUM4tQ== 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; 'python,': 0.02; 'context': 0.05; 'great.': 0.07; 'subject:code': 0.07; 'cc:addr:python-list': 0.09; 'complaining': 0.09; 'forcing': 0.09; 'happens.': 0.09; 'none.': 0.09; 'subject:Why': 0.09; 'subject:not': 0.11; 'output': 0.13; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:allow': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; 'language': 0.19; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'parser': 0.22; 'void': 0.22; 'sat,': 0.23; 'header:In-Reply- To:1': 0.24; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'print': 0.30; 'guess': 0.31; 'primary': 0.31; 'statement': 0.32; 'maybe': 0.33; 'point': 0.33; "i'll": 0.33; 'list': 0.34; 'received:google.com': 0.35; 'returning': 0.35; 'but': 0.36; 'should': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'say': 0.37; 'wanted': 0.37; 'things': 0.38; "won't": 0.38; 'someone': 0.38; 'build': 0.40; 'where': 0.40; 'real': 0.62; '30,': 0.63; 'jul': 0.72; 'yourself': 0.73; '(central)': 0.84; 'chrisa': 0.84; 'etc,': 0.84; 'to:none': 0.91; 'thing,': 0.93 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=VZsJGxQvFhGB9fvJkj1wGg/woOscvxqvk6mZogLG+e0=; b=LGIrZQo6xtPRaAeJRkijbpjXr0cHPIOqaRh0J0YWu0D03EUXsCQGfOQPOKJg0ll93h zC/4896DdtclVtY+GREHfJagCPmkM6/jeZJQBnLXl+TlNarIO+MJQa9m/hMqE56QzMSj vCZiB7BmmRTeFg/gUZwUAmVddi0DyVOLc31DQlLytwZ8hVroJ8wSZJRbf2A5icrqGWlJ WIiFuLLhZDaUV6apWu6PAYSAo/m5AoORxMrY+Dn+SGmzRUH91ke51JzfdVLWH6ci0A88 8b1Ua4yuEbuzrLcUZe2pIpnLvfbmZLcgMftGpzR7lB7o0325rtsrpD7TqOmS1ihCRPIE Xiwg== 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=VZsJGxQvFhGB9fvJkj1wGg/woOscvxqvk6mZogLG+e0=; b=I0Q6ixWGFuyGxgwf10ifqY5HfUXCozPoWtzqGbvK6ccZgfk6DClFYMxLRAxeC+fRl0 SGe9CrT3ba3LAMuSYMO1GdeKDZ7cBw1khWYM+Pm8PGzWxM6eZypfWTXu4QSFrZ52xGlO Sz+QlbhEN4mOIV68gdQeDjFekYtF+6ZgEIFj9VAM4bTQYUQZeFz2WCmgqggkBSWL/Kdz JtYzSr9o6cj+MWYQEqON5YEkqKyMG8Sh+cPAYhvgKE8TCJWIu6naCSTfKG6io3pZpst+ uXmHvlqoR2xdSw+2qwwFJxPkSzz2Z4oSv/NDW7evkV3RF5PGrAndot8Vby7kGzeVSLDl Vdnw== X-Gm-Message-State: AEkoouvjjIRJPaxD9BaDk1k2rxYMBz9FgeAc0Tr8Z9ifaxesaLz4FIrsDCpLtODC/HufxJkuPLnUxrMGEvtknQ== X-Received: by 10.28.45.69 with SMTP id t66mr5780470wmt.41.1469882701320; Sat, 30 Jul 2016 05:45:01 -0700 (PDT) In-Reply-To: <72e60c1c-801a-4a39-a13f-ba8e25d4e870@googlegroups.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> <72e60c1c-801a-4a39-a13f-ba8e25d4e870@googlegroups.com> Xref: csiph.com comp.lang.python:112063 On Sat, Jul 30, 2016 at 10:31 PM, Rustom Mody wrote= : > What makes you think I wanted to print those numbers?? > Maybe I wanted a list of 10 None-s?? Because you NEVER SAID what you wanted! How can you talk about error detection if you won't say what the programmer's intention was? You're forcing us to guess, and then complaining that I guessed wrongly. > Point being that when one mixes up 2 things like that its anybody=E2=80= =99s guess > which is the primary (central) effect and which the =E2=80=98side=E2=80= =99 effect Okay, so my revised guess is: Console output is a primary effect and should not have a secondary effect of returning None. Great. Now please go and build yourself a language in which list.append is a statement (because it shouldn't return None either), etc, etc, just in case someone uses them wrongly. I'll keep using Python, where it's normal for a side-effect-y function to return None - it's much simpler. And even in Pike, where void functions are a real thing, it's possible to recast the function so you can call it in an expression context - and the same thing happens. Truly void functions are nothing but parser convenience. ChrisA