Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.074 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'subject:object': 0.07; 'properly.': 0.09; 'subject:result': 0.16; 'all,': 0.28; 'message- id:@mail.gmail.com': 0.28; 'print': 0.29; 'to:addr:python-list': 0.34; 'received:209.85.161': 0.36; 'none': 0.37; 'element': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'type': 0.61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=3KLDdv5GvWGzcYtNNqUETsM2UQ2vKFq0RTCZpK3KNYQ=; b=u9LH0cw2RkeFD7+7qd1cE1XkrKt8Rsrs9ekPz4kBMis8jmd964Hb4gbRmnR3kVTrv0 3RW1Gz77+ATrZ1Zc5NeRQq2LGkTQ2G7cA4HSsSvd6E4tZWv0lN/XHQmT2xsyBvtmBryB CUYibh5bIx4FCPxrgeYQLDrWLwbjk7YroyzXk= MIME-Version: 1.0 Date: Fri, 25 Nov 2011 14:52:25 +0800 Subject: Strange result ffor object to bool From: ZhouPeng To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1322203948 news.xs4all.nl 6910 [2001:888:2000:d::a6]:54421 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16202 Hi all, In my program, I get a listen element by listen = graphics.find("listen") print listen is print type listen is 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