Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.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.050 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'subject:Why': 0.09; 'cc:addr:python-list': 0.11; '(modulo': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'repr()': 0.16; 'roy': 0.16; 'wrote:': 0.18; 'normally': 0.19; 'cc:addr:python.org': 0.22; 'print': 0.22; 'mon,': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'subject:the': 0.34; 'subject:from': 0.34; 'info': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'two': 0.37; 'explain': 0.39; 'skip:p 20': 0.39; 'even': 0.60; "you'll": 0.62; 'smith': 0.68; 'jul': 0.74; 'same,': 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=kYL2ucNzFP6+FiHSTkzyMi5OS6ljtOCsZBuB38EMlwo=; b=PVzOXfYT6fBpEkMXnUWBA6Gbm1feSiSSpXyRIm3dgZs8azVhmq9XNPahvCXofsa/GN Jil1RgndN3cQ4Rqh/1KU+5mnpt3EpaKJE6PtTVv/mCO7ytyGifZZRlpgJy0F/OcDOrmV v2/5+YHLnMY4qOiIKv+7R3bXtYc8m/rUPOX7CFPL8V9+BMnemTbIMNgCvpa/6UZAPfNu 2TJe2g2/7gBJ72hdrW3V3de7aPzhWi1z1S3wr0R6bwggsfnDTE0vYDN7Yvpol92IcgEH +Kcw9i6bGLKEqj52jToCy4IvNyUmcov7lQUmXAsi4osT2j+kyNSH1MnLQfEoBS1Bu0Og +p3g== MIME-Version: 1.0 X-Received: by 10.52.12.229 with SMTP id b5mr2595067vdc.52.1404657904359; Sun, 06 Jul 2014 07:45:04 -0700 (PDT) In-Reply-To: References: <21e704ee-648b-423d-8682-11cb310a31a8@googlegroups.com> Date: Mon, 7 Jul 2014 00:45:04 +1000 Subject: Re: Why is it different from the example on the tutorial? 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404657907 news.xs4all.nl 2894 [2001:888:2000:d::a6]:32929 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74018 On Mon, Jul 7, 2014 at 12:34 AM, Roy Smith wrote: > * You can print type(foo), to find out exactly what it is (useful when > even printing repr() doesn't explain what's going on). And very VERY occasionally, print(id(type(foo))) comes in handy, because two types might look the same, but an isinstance check looks (modulo subclassing) at type identity. :) But yes, the info Roy listed is normally what you'll be wanting. ChrisA