Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: Useless expressions [was Re: Undefined behaviour in C] Date: Mon, 28 Mar 2016 15:34:59 -0400 Lines: 80 Message-ID: References: <56f55e2e$0$1619$c3e8da3$5496439d@news.astraweb.com> <87wpoq1omm.fsf@elektro.pacujo.net> <56f5f81d$0$1585$c3e8da3$5496439d@news.astraweb.com> <87io0a6j1w.fsf@nightsong.com> <56f67ee3$0$1583$c3e8da3$5496439d@news.astraweb.com> <87poug5t0c.fsf@nightsong.com> <1344e2bf-15d2-412e-9512-b0aba800dada@googlegroups.com> <56f88839$0$1598$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de QplAcXEh+jJLgCdbPMNa/wcWtJc1uL+YL+JVyOtbkX/g== 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; 'debug': 0.04; 'cpython': 0.05; 'expressions': 0.07; 'abort': 0.09; 'garbage': 0.09; 'objects.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'statements': 0.09; 'python': 0.10; 'python.': 0.11; 'jan': 0.11; 'syntax': 0.13; 'interpreter': 0.15; 'languages,': 0.15; '(about': 0.16; '2016': 0.16; 'collected.': 0.16; 'discuss.': 0.16; 'hypothetical': 0.16; 'outputs': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'statements,': 0.16; 'subject:expressions': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'result,': 0.18; 'say,': 0.18; 'runs': 0.18; '>>>': 0.20; 'saying': 0.22; 'disable': 0.22; 'am,': 0.23; 'code,': 0.23; 'bit': 0.23; 'sets': 0.23; 'slightly': 0.23; 'specified': 0.23; 'split': 0.23; 'header:In-Reply-To:1': 0.24; 'feature': 0.24; 'mon,': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints- To:1': 0.26; 'sense': 0.26; 'sequence': 0.27; "skip:' 10": 0.28; 'actual': 0.28; 'mode.': 0.29; 'subject: [': 0.29; 'objects': 0.29; 'raise': 0.29; 'print': 0.30; 'language.': 0.32; 'statement': 0.32; 'run': 0.33; 'useful': 0.33; 'url:python': 0.33; 'third': 0.33; 'builds': 0.33; 'clarify': 0.33; "d'aprano": 0.33; 'steven': 0.33; "i'll": 0.33; 'definition': 0.34; 'so,': 0.35; 'execution': 0.35; 'quite': 0.35; 'but': 0.36; 'url:org': 0.36; 'basic': 0.36; 'mode': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'display': 0.37; 'received:org': 0.37; 'difference': 0.38; 'itself': 0.38; 'anything': 0.38; 'mean': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'collection': 0.60; 'url:3': 0.60; 'him': 0.60; 'your': 0.60; 'behavior': 0.61; 'skip:n 10': 0.62; 'received:96': 0.63; 'more': 0.63; 'different': 0.63; 'information': 0.63; 'mar': 0.65; 'remember,': 0.66; 'legal': 0.66; 'evaluate': 0.72; 'dialect': 0.84; 'dialects.': 0.84; 'ideas.': 0.84; 'intending': 0.84; 'sort.': 0.84; 'different.': 0.91; 'received:fios.verizon.net': 0.91; 'url:reference': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-96-227-207-81.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 In-Reply-To: <56f88839$0$1598$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105918 On 3/27/2016 9:26 PM, Steven D'Aprano wrote: > On Mon, 28 Mar 2016 03:39 am, Terry Reedy wrote: >> So Bart is proposing whether 'actually' or 'hypothetically' > I don't think Bart is intending this as an actual proposal to change Python > so much as just a hypothetical to discuss. I don't remember Bart saying anything of the sort. I'll let him clarify hit meaning. >> to either disable an extremely useful feature or >> split Python into two slightly different dialects. I think both are bad >> ideas. > > I don't think that's quite fair. I don't think your strained nitpicking of my statement is quite fair. It is definitely faulty. > The interactive interpreter is already > slightly different from non-interactive use, Yes, the extra behavior of interactive mode is specified in the Reference in the section on Expression statements. https://docs.python.org/3/reference/simple_stmts.html#expression-statements But as far as I can remember, both run the *SAME PYTHON LANGUAGE*. Dialects are a property of languages, not of interpreter modes. > in that bare expressions print the result, Expressions evaluate to objects. Having the interpreter also display the object is at most an added semantic. It is not a syntax difference and in that sense is not a *language* difference*. > while in non-interactive use they just get garbage collected. Garbage collection is not relevant to this proposal or discussion. AFAIK, Objects become eligible for garbage collection at the same time in either mode. > It wouldn't be that different to change "print versus ignore" into "print > versus raise error". Are you serious? Having the *same code* execute in one mode and raise in another, and thereby abort execution of all following code, is quite different. It makes the set of legal statements different and that is the basic definition of a language. It suite fair to call the different sets of legal statements 'slightly different dialects'. > I think it is a bit extreme to call that two different > dialects. Your nitpicking is what is extreme. > If so, then the current interactive interpreter is also a > different dialect. To repeat, the current interactive interpreter runs the same sequence of statements, which is to say, the same language. It just outputs extra information about what is going on. CPython debug builds display even more extra information (about references). >>> 0 0 [44187 refs] >>> a=0 [44189 refs] >>> 0 0 [44189 refs] This in itself does not mean that the debug interactive interpreter is yet a third dialect of Python. -- Terry Jan Reedy