Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; "'',": 0.07; 'none,': 0.07; 'none)': 0.09; 'subject:None': 0.09; 'subject:string': 0.09; 'none.': 0.16; 'wrote:': 0.18; 'first.': 0.19; 'examples': 0.20; '>>>': 0.22; 'mon,': 0.24; "i've": 0.25; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'usually': 0.31; 'constant': 0.31; 'classes': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'first': 0.61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Q9l8HxoChneKFr1CAP2ri5sCtXvgYjt8q0IKFR7mry8=; b=tgwfJQJvDvrZAiUk/qrsc5uZZJwpCNIC6gnvsfNQoemftXIKOMpzOj2rN4RRpZhoUP oIn+d45pERDalmmbqyJCRnjHb+raG6uCBuZMjScEU2cQoDi7RRmbS5sZ+N8X3BII3cW5 Fq9fpZGr4t1aYXhW3/DEoF6ygYQYuY357PrzkziZNV8O7hPiwDaub8Plfm23dqNIqSIq dW6crZ0tvuOWjYda2PVDa6XBXfGUCq6dP/aVAuylTG8N0oELHWDyevhOGbAPRbpmZeW3 7hwz+pMrt5c1RUbAtfYMElxEuoRbxmOSaN8+EBOGWTiByJWMrHmYli7TyE+IlYUTSc3t gNTA== X-Received: by 10.236.42.52 with SMTP id i40mr3984092yhb.119.1402336736888; Mon, 09 Jun 2014 10:58:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <048960da-c132-407f-b1b3-4612a3dd7697@googlegroups.com> <20140609185728.3cac55ab@x34f> <03B8D21C-62B4-4344-AA25-FF82501C33D0@panix.com> From: Ian Kelly Date: Mon, 9 Jun 2014 11:58:16 -0600 Subject: Re: None in string => TypeError? To: Python 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402336745 news.xs4all.nl 2885 [2001:888:2000:d::a6]:58632 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73055 On Mon, Jun 9, 2014 at 11:40 AM, Chris Angelico wrote: > Also, this is the first time I've seen None as a constant other than > the first. Usually co_consts[0] is None, but this time co_consts[4] is > None. Functions always seem to have None as the first constant, but modules and classes are other examples that don't. >>> co = compile("class MyClass: pass", '', 'exec') >>> co.co_consts (, 'MyClass', None) >>> co.co_consts[0].co_consts ('MyClass', None)