Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.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; 'guido': 0.05; 'messages.': 0.05; 'attribute': 0.07; 'error:': 0.07; 'imported': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'ah,': 0.16; 'brackets': 0.16; 'clear.': 0.16; 'dictionary,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'notation': 0.16; 'reedy': 0.16; 'wrote:': 0.18; 'module': 0.19; 'version.': 0.19; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; '31,': 0.24; 'instead.': 0.24; 'module,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'apparently': 0.31; 'explained': 0.31; 'fri,': 0.33; 'skip:_ 10': 0.34; 'maybe': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'clear': 0.37; 'depends': 0.38; 'pm,': 0.38; 'love': 0.65; 'square': 0.74; "'all'": 0.84; 'subject:Statement': 0.91; 'subject:True': 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=dDSwS5yrsT2pfnf2PIkW3THGbesU4UB66Zip1RFaBGY=; b=K2YPKGntwBzdP8sYlASrjl0X6hZ6Ovn+OJ9p+EA+5UZalUEPoqmJNM9EZbG3fI41DQ M/APJUNGhL030JD9E0XrQAC2RbWtZBx8xWrSysYGrvDNekMrNXMKIhIypsTNknA0wJKW PqtONA3LNENVJgAm4W3XLEnNHUvxnG1kQ0yMrPKTUBDmen5E5AE+581ebH9zEcqKhsCp uboprWeKSzDianUGij9QygrPuGYFQXUKnQfON936AH/6HcV2MLVILgNayfkq8QDtB4GY XRGSMqA2mUgmD60OuMvTUjEfDlk30MPnvjX/vX9SGTBYIJgcJ9lcZGyaIwUTb9IzBGpD LErA== MIME-Version: 1.0 X-Received: by 10.66.102.39 with SMTP id fl7mr18485906pab.43.1391144870995; Thu, 30 Jan 2014 21:07:50 -0800 (PST) In-Reply-To: References: <13a1aca8-a246-4618-925f-05ebf6c2e950@googlegroups.com> Date: Fri, 31 Jan 2014 16:07:50 +1100 Subject: Re: Statement evals as False in my IDE and True elsewhere 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391144879 news.xs4all.nl 2872 [2001:888:2000:d::a6]:47891 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65090 On Fri, Jan 31, 2014 at 4:05 PM, Terry Reedy wrote: > On 1/30/2014 5:55 PM, Chris Angelico wrote: >> >> On Fri, Jan 31, 2014 at 9:48 AM, CM wrote: >>> >>> builtin_all = __builtins__.all >>> >>> but I got the error: >>> >>> AttributeError: 'dict' object has no attribute 'all' >> >> >> Try using square brackets notation instead. Apparently your >> __builtins__ is a dictionary, not a module, though I don't know why > > > For technical reasons Guido once explained and I have fogotten, it depends > on whether you are in main module or an imported module -- and maybe the > Python version. Ah, okay. Anyway, the error message makes it clear. I love clear error messages. ChrisA