Statement evals as False in my IDE and True elsewhere

Chris Angelico rosuav at gmail.com
Fri Jan 31 00:07:50 EST 2014


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



More information about the Python-list mailing list