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


Groups > comp.lang.python > #65090

Re: Statement evals as False in my IDE and True elsewhere

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 <rosuav@gmail.com>
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 <lcfau9$va2$1@ger.gmane.org>
References <a543e1a5-ef00-42b0-96df-5bf9ee8ac74c@googlegroups.com> <mailman.6169.1391120094.18130.python-list@python.org> <13a1aca8-a246-4618-925f-05ebf6c2e950@googlegroups.com> <CAPTjJmr3i4Zk1sxF9nQJmzxLoLOYXGyMGf6UwTYv2uiVyX3Y2Q@mail.gmail.com> <lcfau9$va2$1@ger.gmane.org>
Date Fri, 31 Jan 2014 16:07:50 +1100
Subject Re: Statement evals as False in my IDE and True elsewhere
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.6191.1391144879.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Fri, Jan 31, 2014 at 4:05 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> On 1/30/2014 5:55 PM, Chris Angelico wrote:
>>
>> On Fri, Jan 31, 2014 at 9:48 AM, CM <cmpython@gmail.com> 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

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


Thread

Statement evals as False in my IDE and True elsewhere CM <cmpython@gmail.com> - 2014-01-30 14:04 -0800
  Re: Statement evals as False in my IDE and True elsewhere Peter Otten <__peter__@web.de> - 2014-01-30 23:14 +0100
    Re: Statement evals as False in my IDE and True elsewhere CM <cmpython@gmail.com> - 2014-01-30 14:48 -0800
      Re: Statement evals as False in my IDE and True elsewhere Chris Angelico <rosuav@gmail.com> - 2014-01-31 09:55 +1100
        Re: Statement evals as False in my IDE and True elsewhere CM <cmpython@gmail.com> - 2014-01-30 15:02 -0800
      Re: Statement evals as False in my IDE and True elsewhere Peter Otten <__peter__@web.de> - 2014-01-31 00:08 +0100
      Re: Statement evals as False in my IDE and True elsewhere Terry Reedy <tjreedy@udel.edu> - 2014-01-31 00:05 -0500
      Re: Statement evals as False in my IDE and True elsewhere Chris Angelico <rosuav@gmail.com> - 2014-01-31 16:07 +1100
  Re: Statement evals as False in my IDE and True elsewhere Chris Angelico <rosuav@gmail.com> - 2014-01-31 09:25 +1100
    Re: Statement evals as False in my IDE and True elsewhere CM <cmpython@gmail.com> - 2014-01-30 15:00 -0800
      Re: Statement evals as False in my IDE and True elsewhere Chris Angelico <rosuav@gmail.com> - 2014-01-31 10:25 +1100
      Re: Statement evals as False in my IDE and True elsewhere Terry Reedy <tjreedy@udel.edu> - 2014-01-31 00:09 -0500

csiph-web