Strange result ffor object to bool

ZhouPeng zpengxen at gmail.com
Fri Nov 25 01:52:25 EST 2011


Hi all,

In my program, I get a listen element by
listen = graphics.find("listen")

print listen is <Element listen at 6afc20>
print type listen is <type 'instance'>
I am sure listen is not None and can be accessed properly.

But print bool(listen) is False
if not listen  is True

-- 
Zhou Peng



More information about the Python-list mailing list