Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74018

Re: Why is it different from the example on the tutorial?

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 <rosuav@gmail.com>
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 <roy-3DFFFC.10344406072014@news.panix.com>
References <f949d1c4-98c4-417f-9abc-58fe72b4c0a0@googlegroups.com> <mailman.11537.1404651349.18130.python-list@python.org> <c8f935e5-cd8f-4589-a70c-b172a985e22b@googlegroups.com> <21e704ee-648b-423d-8682-11cb310a31a8@googlegroups.com> <roy-3DFFFC.10344406072014@news.panix.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 <rosuav@gmail.com>
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.11541.1404657907.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Mon, Jul 7, 2014 at 12:34 AM, Roy Smith <roy@panix.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why is it different from the example on the tutorial? rxjwg98@gmail.com - 2014-07-06 05:13 -0700
  Re: Why is it different from the example on the tutorial? Tim Chase <python.list@tim.thechases.com> - 2014-07-06 07:54 -0500
    Re: Why is it different from the example on the tutorial? rxjwg98@gmail.com - 2014-07-06 06:38 -0700
      Re: Why is it different from the example on the tutorial? Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-06 07:18 -0700
        Re: Why is it different from the example on the tutorial? Roy Smith <roy@panix.com> - 2014-07-06 10:34 -0400
          Re: Why is it different from the example on the tutorial? Chris Angelico <rosuav@gmail.com> - 2014-07-07 00:45 +1000
          Re: Why is it different from the example on the tutorial? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-06 15:47 +0100
          Re: Why is it different from the example on the tutorial? Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-06 08:53 -0700
            Re: Why is it different from the example on the tutorial? Roy Smith <roy@panix.com> - 2014-07-06 12:01 -0400
        Re: Why is it different from the example on the tutorial? rxjwg98@gmail.com - 2014-07-06 08:03 -0700
          Re: Why is it different from the example on the tutorial? Peter Otten <__peter__@web.de> - 2014-07-06 17:46 +0200
          Re: Why is it different from the example on the tutorial? Rick Johnson <rantingrickjohnson@gmail.com> - 2014-07-06 09:02 -0700
          Re: Why is it different from the example on the tutorial? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-06 19:29 +0100
          Re: Why is it different from the example on the tutorial? Larry Hudson <orgnut@yahoo.com> - 2014-07-06 13:32 -0700
            Re: Why is it different from the example on the tutorial? rxjwg98@gmail.com - 2014-07-06 13:42 -0700
      Re: Why is it different from the example on the tutorial? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-06 15:25 +0100
  Re: Why is it different from the example on the tutorial? Rustom Mody <rustompmody@gmail.com> - 2014-07-06 09:01 -0700

csiph-web