Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.05; 'output': 0.05; '(except': 0.07; 'none,': 0.07; 'cc:addr:python- list': 0.11; 'def': 0.12; '"is': 0.16; '4:39': 0.16; 'arg': 0.16; 'btw': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'outputs': 0.16; 'repl': 0.16; 'repr()': 0.16; 'str()': 0.16; 'folks': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'thu,': 0.19; 'meant': 0.20; 'cc:addr:python.org': 0.22; 'print': 0.22; "haven't": 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; 'wonder': 0.29; 'message-id:@mail.gmail.com': 0.30; '-0700,': 0.31; '>>>>': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'objects': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'displays': 0.38; 'pm,': 0.38; 'sure': 0.39; 'how': 0.40; 'our': 0.64; 'between': 0.67; 'behavior': 0.77; 'was:': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=gVdTzliHgQ+TONV+1NWoI8tXrECi8z1AJHT9jeUnA5g=; b=OmHLO52gkp2RDAfsBVoGY/ykquZPqXGd/8nUsPDJcjs/8Zo9gjECfKCrGCrhyg5b4x V7T13kI7b2d6k6Mf+yE0aoKwXB2FAv55l2EaupgPk799Kgzs6ZDMWa40imW4eY9rUUpC RmwBZtJ3DHhFaMQlRNOQQp9Vp3Ms9jFwhcU5+vgiOj+GyE6tZ7XtHRzd/GZk0EsxIhvN b8KVu8bvX8+C8e1WtVCakuvo6cOlqhe7+ZIQT5SqNaG/dJu5bGmmFqOAqD0KlZXrD+Vl R/aeGPCkLSTQh++ERWeeoqX2xM8VMdpO+yspWWmvJvtxG7NFDwq3adhPvY8/FQetm8MZ CUhQ== MIME-Version: 1.0 X-Received: by 10.50.66.174 with SMTP id g14mr27523191igt.34.1412834103179; Wed, 08 Oct 2014 22:55:03 -0700 (PDT) In-Reply-To: <8dba70e4-9670-40d3-9a3f-d2b593d52ac6@googlegroups.com> References: <64c26ed7-33cc-4be9-93ac-8d2b84b92451@googlegroups.com> <5436157d$0$12918$c3e8da3$5496439d@news.astraweb.com> <8dba70e4-9670-40d3-9a3f-d2b593d52ac6@googlegroups.com> Date: Thu, 9 Oct 2014 16:55:03 +1100 Subject: Re: Toggle From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412834106 news.xs4all.nl 2903 [2001:888:2000:d::a6]:33682 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78877 On Thu, Oct 9, 2014 at 4:39 PM, 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? I haven't used a proprinter since our XL24E died. Never used an antiprinter, myself. Here's how to make print() output the repr() of something: _ORIG_PRINT = print def print(*args, **kw): return _ORIG_PRINT(*(repr(arg) for arg in args), **kw) But what's the point? (Also: Have fun backporting that to 2.5, it won't be easy.) ChrisA