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: Sun, 31 Jul 2016 12:17:04 +1000 Lines: 33 Message-ID: References: <87vazwppxx.fsf@elektro.pacujo.net> <579B1ABB.1070500@rece.vub.ac.be> <579c2095$0$22142$c3e8da3$5496439d@news.astraweb.com> <579cbded$0$1605$c3e8da3$5496439d@news.astraweb.com> <758a1961-00bc-4b1c-834b-a7deca94d029@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de r2X7BDZA0roq5HIaHgWVvgF+cq6PdiLE8i6kmvnlN2ZA== 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; '"as': 0.07; 'compile- time': 0.07; 'subject:code': 0.07; 'api': 0.09; 'cc:addr:python- list': 0.09; 'merged': 0.09; 'none"': 0.09; 'subject:Why': 0.09; 'subject:not': 0.11; 'ignore': 0.14; 'result.': 0.15; '"always': 0.16; '2016': 0.16; 'distinction': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'gregory': 0.16; 'personally,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'stark': 0.16; 'subject:allow': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '31,': 0.22; 'pascal': 0.22; 'am,': 0.23; 'decide': 0.23; '(this': 0.24; 'header:In-Reply-To:1': 0.24; 'all.': 0.24; '(which': 0.26; 'chris': 0.26; 'error': 0.27; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'errors.': 0.27; 'function': 0.28; 'values': 0.28; 'callable': 0.29; 'does,': 0.29; 'objects': 0.29; 'classes': 0.30; 'code': 0.30; 'certain': 0.31; "can't": 0.32; 'useful': 0.33; 'languages': 0.34; 'received:google.com': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'seem': 0.37; 'difference': 0.38; 'means': 0.39; "didn't": 0.39; 'well.': 0.40; 'called': 0.40; 'care': 0.60; 'great': 0.63; 'between': 0.65; 'fundamental': 0.66; 'decided': 0.66; 'jul': 0.72; '11:45': 0.84; 'chrisa': 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=sADe1NtVQ2NhSA5CuE29nFL+J8pT/XJCmUd4d0o2zGY=; b=TfY53zitFe4wdoT4hjhVeE0gfu0izZAN5A3BApvBCY1WU3afF8Wu0kmDW4vIBaZJ8V APhbEBzThir2tEg1jL+oXHWAw1dYy3HPvzADug6j6bqF6+fFJJUjPoWrresWYwWXuuzh RXB0t8JmGRIRhH3GutT60kyv/YeGiQslGyaufxhJl1UUOwXvg5u2C8UZ/d3VGCJKJ22k Dk0/B6IZ+nUej2qaBeaFc7bfZ7pcuvRYUUkG8zZI4NtpeW59ZDSghA+Vjg/9dV2BNGFx DZR0Ns8wWSo9DLMPwJHS/zaaUVfen3cqF5Xeixcxl0L9ox0qbilA2yYIxzxxmZZ50+cD 9wYQ== 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=sADe1NtVQ2NhSA5CuE29nFL+J8pT/XJCmUd4d0o2zGY=; b=m8I1NObtkjKqwFZP6HKUwlCfZ8GMjANpRJp9BG8NNKn/At+Upp/jW8aCucircHEefI etF+aQvDfR1uFer+k54YNaLKVp4GwxSXQbNQw94FMIb7ABGmmSaaMJhkcJwz0nptcVkc PQvWorkhBtC24nEIMTn9KTu5GVAfg+9OUwuWUVZl8psWhSLgdD6/1f/0sX8aeJSG1lNX 7p+U7mmJYB+pJd7HRN24SIorTYE3/crVMJSWjdcgWbmd+GsstN1+R5OGxpK2BNdkmLt1 Kxgk+JzyM4WpFVTSyewaQQLtI1XkwBf66ugwKM8/6u8Z5e2EUiFbi1R3sO4nOHzkcPrk Ij/g== X-Gm-Message-State: AEkoousbZ+pCCr6AB5CPqlnDZ2kj4Bp2PoDnnJu/bYNAyBzVc7NxMvEu4bRqp2koSL3xJaDQFI5EekQwsjczcQ== X-Received: by 10.194.175.38 with SMTP id bx6mr49129643wjc.47.1469931425135; Sat, 30 Jul 2016 19:17:05 -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: <87vazwppxx.fsf@elektro.pacujo.net> <579B1ABB.1070500@rece.vub.ac.be> <579c2095$0$22142$c3e8da3$5496439d@news.astraweb.com> <579cbded$0$1605$c3e8da3$5496439d@news.astraweb.com> <758a1961-00bc-4b1c-834b-a7deca94d029@googlegroups.com> Xref: csiph.com comp.lang.python:112107 On Sun, Jul 31, 2016 at 11:45 AM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> So do I need to be able to "call a function as if it >> were a procedure", or is there a stark difference between the two >> types of callable? > > > Well, Pascal makes a stark distinction between them -- it's > a compile-time error to call a procedure as though it were > a function or vice versa in Pascal -- and it didn't seem to > cause any great problems. > > So it's at least possible to write useful code under such > circumstances, and it might even help to catch certain > classes of errors. But the ability to ignore return values > can be useful as well. Most languages since have decided > not to make the distinction, and don't seem to have > suffered noticeably as a result. Yeah. The distinction means you have a fundamental API difference between the procedures (which don't return anything) and the functions (whose return values you mightn't care about). It means you can't upgrade something from "always returns None" to "returns the number of objects frobbed" without breaking compat. Conversely, if you decide that any function can be called "as a procedure" (this is what REXX does, for instance), then you've just merged the two types of callable and distinguished them only in usage. Personally, I don't see any value to the distinction at all. ChrisA