Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'attribute': 0.07; 'error:': 0.07; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'brackets': 0.16; 'dictionary,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'notation': 0.16; 'used).': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; '31,': 0.24; 'instead.': 0.24; 'module,': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'apparently': 0.31; 'fri,': 0.33; 'skip:_ 10': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'square': 0.74; "'all'": 0.84; '(probably': 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=Vr0kgfpKHM4tJWGwxTZi5oNQYt98NTS618Yii3nGkds=; b=Qibg8sJbabU3CvJPwa+ebgPFcOx7zHoMYS7Bg+Mdp74fRogOJ3gohNm/34RrJrEcZL pYFJvIHfQbZZEbSr9vOjAwDvAKpcjkKEPQb+7YAbh3nUXT9GItEhUz24aS+IcZP0eFvR gmBIvrlBHRX0Uv5xf3cyfALlfiEEeOzn1HShcsjd2fkuW4Bxqiba4oFmksRr9HmPfePr jteNe4EQcE+zAxNP91qs9TkrUrGw+gZwQByHATjBX4avp12AYvD+SOSU+51/IGOFG9eZ u2EH+aNnXTk+7F2I/SaiQUY5jPW2sF28umJKDpuY1tI9MTqAzKdWPH06B7q+cDlAROqs pIsA== MIME-Version: 1.0 X-Received: by 10.68.162.66 with SMTP id xy2mr17252483pbb.46.1391122535449; Thu, 30 Jan 2014 14:55:35 -0800 (PST) In-Reply-To: <13a1aca8-a246-4618-925f-05ebf6c2e950@googlegroups.com> References: <13a1aca8-a246-4618-925f-05ebf6c2e950@googlegroups.com> Date: Fri, 31 Jan 2014 09:55:35 +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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391122543 news.xs4all.nl 2918 [2001:888:2000:d::a6]:51597 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65061 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 (probably something to do with numpy, which I've never actually used). But try this: builtin_all = __builtins__["all"] It might work. ChrisA