Statement evals as False in my IDE and True elsewhere

CM cmpython at gmail.com
Thu Jan 30 17:04:00 EST 2014


This is puzzling.  (Using Python 2.5, WinXP, Boa Constructor 0.6.1 definitely running the code through Python 2.5)

If I run these lines in my program, through my IDE (Boa Constructor), 

    fake_data = ['n/a', 'n/a', 'n/a', 'n/a', '[omitted]', '12']
    fake_result = not all(i == '[omitted]' for i in fake_data)
    print 'This is fake result: ', fake_result

I get this result:

>>> 
This is fake result:  False

BUT, if I run those *exact same lines* (copied and pasted) in the Python 2.5 shell within Boa Constructor, or with IDLE with Python 2.5, I get:

>>> 
This is fake result:  True

...which is what it seems like it should evaluate to, right?  What the heck is going on?  How is this even possible?  There is nothing that I know of in my code to cause this change, but perhaps there is.  Otherwise I am at a total loss.

Thanks,
Che M



More information about the Python-list mailing list