Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #16202
| Date | 2011-11-25 14:52 +0800 |
|---|---|
| Subject | Strange result ffor object to bool |
| From | ZhouPeng <zpengxen@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3026.1322203948.27778.python-list@python.org> (permalink) |
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
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Strange result ffor object to bool ZhouPeng <zpengxen@gmail.com> - 2011-11-25 14:52 +0800 Re: Strange result ffor object to bool Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-25 08:59 +0000
csiph-web