Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'explicitly': 0.04; 'clause': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:while': 0.09; 'value.': 0.15; '"...': 0.16; 'confusion': 0.16; 'none"': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'url:documentation': 0.16; 'wrote:': 0.17; 'sort': 0.21; 'laura': 0.22; 'branch': 0.23; 'statement': 0.23; '(see': 0.27; 'andrew': 0.27; 'header:X-Complaints-To:1': 0.28; "d'aprano": 0.29; 'steven': 0.29; 'included': 0.29; 'url:home': 0.33; 'to:addr :python-list': 0.33; 'received:org': 0.36; 'but': 0.36; 'url:org': 0.36; 'charset:us-ascii': 0.36; 'turn': 0.36; 'why': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'link': 0.60; 'behavior': 0.64; 'jul': 0.65; 'hey,': 0.72; 'truth': 0.75; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Implicit conversion to boolean in if and while statements Date: Mon, 16 Jul 2012 13:28:14 -0400 Organization: > Bestiaria Support Staff < References: <5002a1f9$0$29995$c3e8da3$5496439d@news.astraweb.com> <50037eab$0$29995$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-253-106-193.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342459699 news.xs4all.nl 6961 [2001:888:2000:d::a6]:56632 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25431 On 16 Jul 2012 02:38:35 GMT, Steven D'Aprano declaimed the following in gmane.comp.python.general: > On Sun, 15 Jul 2012 12:02:37 -0500, Andrew Berg wrote: > > > Okay, I see the value in this, but I don't understand why None has a > > truth value. > > And this is exactly the sort of mental confusion that Laura Crichton > warned about (see the link I included earlier). > Would one rather have the behavior seen in SQL for Null? http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/Firebird-Null-Guide.pdf Hey, let's turn the IF statement into tri-state logic... if cond: #true branch else: #false branch unknown: #when cond includes a None term that was NOT explicitly #part of a "... is {not} None" clause -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/