Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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; 'subject:error': 0.03; 'skip:[ 20': 0.04; 'mrab': 0.05; 'string.': 0.05; 'none:': 0.07; 'exception.': 0.09; 'python': 0.11; '>on': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'pathological': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'repr': 0.16; 'simplicity,': 0.16; 'simpson': 0.16; 'sat,': 0.16; 'wrote:': 0.18; "python's": 0.19; '>>>': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'cheers,': 0.24; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'mode': 0.30; '+0100,': 0.31; 'compatible': 0.32; 'there': 0.35; 'received:com.au': 0.36; 'skip:> 10': 0.36; 'charset:us-ascii': 0.36; 'clear': 0.37; 'apple': 0.38; 'received:211': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'expression': 0.60; 'free': 0.61; 'subject: ': 0.61; 'new': 0.61; 'content-disposition:inline': 0.62; 'more': 0.64; 'great': 0.65; 'stated': 0.69; '2014,': 0.84; '4.2.1': 0.84; 'adrian': 0.91; 'subject:Lists': 0.91 Date: Sat, 25 Oct 2014 11:52:21 +1100 From: Cameron Simpson To: python-list@python.org Subject: Re: I am out of trial and error again Lists MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) References: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=YuQlxtEQCowy2cfE5kc7TA==:117 a=YuQlxtEQCowy2cfE5kc7TA==:17 a=ZtCCktOnAAAA:8 a=PO7r1zJSAAAA:8 a=LcaDllckn3IA:10 a=r5UFkecV8NkA:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=EBOSESyhAAAA:8 a=bnQAcAMOn7_XvKYHi5IA:9 a=CjuIK1q_8ugA:10 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: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414199621 news.xs4all.nl 2948 [2001:888:2000:d::a6]:43872 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79642 On 24Oct2014 20:37, Seymore4Head wrote: >On Sat, 25 Oct 2014 01:20:53 +0100, MRAB >>One function you can use is repr: >> >>x = 1 >>y = "1" >>print(repr(x)) >>print(repr(y)) >> >>This will print: >> >>1 >>'1' >> >>OK, now it's clear that x is an int and y is a string. > >Yes In particular, Python's interactive mode uses repr to print the result of any expression that whose value was not None: [/Users/cameron]fleet*> python Python 2.7.8 (default, Oct 3 2014, 02:34:26) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> x=1 >>> y='1' >>> x 1 >>> y '1' >>> so you get this for free in that mode. Cheers, Cameron Simpson If your new theorem can be stated with great simplicity, then there will exist a pathological exception. - Adrian Mathesis