Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; '(except': 0.07; 'none,': 0.07; 'sys': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.12; '"is': 0.16; 'btw': 0.16; 'outputs': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'repl': 0.16; 'repr()': 0.16; 'str()': 0.16; 'tweak': 0.16; 'folks': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'meant': 0.20; '>>>': 0.22; 'import': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; '(or': 0.24; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'wonder': 0.29; '-0700,': 0.31; '>>>>': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'objects': 0.35; 'but': 0.35; 'there': 0.35; 'displays': 0.38; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'between': 0.67; 'behavior': 0.77; 'was:': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: Toggle Date: Thu, 09 Oct 2014 09:51:13 +0200 Organization: None References: <64c26ed7-33cc-4be9-93ac-8d2b84b92451@googlegroups.com> <5436157d$0$12918$c3e8da3$5496439d@news.astraweb.com> <8dba70e4-9670-40d3-9a3f-d2b593d52ac6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p57bdbee7.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412841089 news.xs4all.nl 2929 [2001:888:2000:d::a6]:48891 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78880 Rustom Mody wrote: > On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote: >> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: > >> >>>> Color.Red >> >>>> print (Color.Red) >> > Color.Red >> > # Not sure what to make of that distinction... > >> That's because the interactive interpreter displays the repr() of objects >> (except for None, which it suppresses), while print outputs the str() of >> them. > > Yeah... > > What I meant to wonder upon was: "Is this behavior what the pro-print or > the anti-print folks like?" > > In any case that the P in REPL is not *exactly* the same as print > (or equivalently the distinction between str and repr) makes for some > intricate noob confusions. > > BTW is there some flag that can make them identical? No flag, but you can tweak that P: >>> import sys >>> sys.displayhook = print >>> "foo" foo >>> def f(): pass ... >>> f() None