Path: csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!bcyclone02.am1.xlned.com!bcyclone02.am1.xlned.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'ide': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'repl': 0.09; 'python': 0.10; 'value.': 0.15; 'assignments': 0.16; 'distinction': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'do.': 0.22; '(on': 0.22; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'header:X -Complaints-To:1': 0.26; 'function': 0.28; 'looks': 0.29; 'print': 0.30; "d'aprano": 0.33; 'received:comcast.net': 0.33; 'steven': 0.33; 'list': 0.34; 'could': 0.35; 'something': 0.35; "isn't": 0.35; 'lines': 0.36; 'assigned': 0.36; "wasn't": 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'turn': 0.37; 'say': 0.37; 'received:org': 0.37; 'anything': 0.38; 'takes': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'some': 0.40; 'more': 0.63; 'to,': 0.63; 'within': 0.64; 'between': 0.65; 'rare': 0.66; 'special': 0.73; 'have.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Random832 Subject: Re: Python handles globals badly. Date: Tue, 15 Sep 2015 21:54:02 -0400 References: <86fa425b-d660-45ba-b0f7-3beebdec8e14@googlegroups.com> <55EE9EEC.1060907@rece.vub.ac.be> <55EEDD37.5090602@gmx.com> <55f072aa$0$1669$c3e8da3$5496439d@news.astraweb.com> <55F130CE.5060203@rece.vub.ac.be> <55F191CD.8040901@gmail.com> <55f3a08d$0$1674$c3e8da3$5496439d@news.astraweb.com> <55f8c248$0$1649$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain X-Gmane-NNTP-Posting-Host: c-68-39-146-59.hsd1.in.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:98Bib1P2aqeqNFInoiqSjFIJ9NY= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442368458 news.xs4all.nl 23802 [2001:888:2000:d::a6]:55556 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4260 X-Received-Body-CRC: 2464628341 Xref: csiph.com comp.lang.python:96654 Steven D'Aprano writes: > I don't need to see 23 printed, because I already know what the value is, so > that takes two lines where one would do. (On the rare case I did want to > see the value of something I had just assigned to, I could just print the > expression.) Of course, you could just as well say that you _never_ need to see anything printed unless you ask for it. The first time I used the REPL I was irritated by the fact that None wasn't printed. The reason that None isn't printed is, of course, because Python has no distinction between a function that returns None as a value and a function that doesn't return a value. The alternative is to make assignments special within the REPL, or even turn it into something that looks less like a REPL and more like the variable/expression list that some IDE debuggers have.