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


Groups > comp.lang.python > #65089

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

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Statement evals as False in my IDE and True elsewhere
Date 2014-01-31 00:05 -0500
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>
Newsgroups comp.lang.python
Message-ID <mailman.6190.1391144738.18130.python-list@python.org> (permalink)

Show all headers | View raw


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.

-- 
Terry Jan Reedy

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