Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(python': 0.05; '3),': 0.09; 'ignoring': 0.09; 'methods,': 0.09; 'spelled': 0.09; 'subject:while': 0.09; 'cc:addr:python-list': 0.10; 'said.': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.17; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; "d'aprano": 0.29; 'steven': 0.29; 'received:209.85.160.46': 0.32; 'received:google.com': 0.34; 'received:209.85': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'called': 0.39; 'header:Received:5': 0.40; 'jul': 0.65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=pDylRH4lCPO5uqEn9TDasKWmQ6ZfIZ5/Ch7R4yMJex8=; b=zS2E0vYQaPr1Oo1czGitLZMZisZ0ZiJZS6ztOXsyd7gefZWMb3dF9c8qx4XxSO2bf4 k2A05hbf0+OBgf6QbG4TtEIWRcPlp7R2q8o0qH1VT8CEW994c+tUEtAvBouVCuK7h6pS SmDM1OHhojcWs1noNUmBDXRn/Eq+WMjF7U+NJJg/p8VrWFWNHsiLqa7Z7z0osVn4goUL nvcYADxO9cp1/qSTdoR2thJFYSlnEdIDawge41e9iZD0toX8TiNqt8mChBzubtWi5L4q Hc5lHCqO2C/K+PWgganfqeYzl5NCDGKyVbVNDATMahGuOT0YmJQiGDQlmdmyNpn9wuCS bBdQ== MIME-Version: 1.0 In-Reply-To: <50050567$0$30002$c3e8da3$5496439d@news.astraweb.com> References: <5002a1f9$0$29995$c3e8da3$5496439d@news.astraweb.com> <7b027612-a07e-40f9-8ad2-3e95c5440482@googlegroups.com> <86872ad2-fda0-403b-9f18-d1cb18e41860@t32g2000yqd.googlegroups.com> <50039290$0$29978$c3e8da3$5496439d@news.astraweb.com> <50050567$0$30002$c3e8da3$5496439d@news.astraweb.com> From: Devin Jeanpierre Date: Tue, 17 Jul 2012 05:38:07 -0400 Subject: Re: Implicit conversion to boolean in if and while statements To: "Steven D'Aprano" Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342517936 news.xs4all.nl 6858 [2001:888:2000:d::a6]:54635 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25477 On Tue, Jul 17, 2012 at 2:25 AM, Steven D'Aprano wrote: > It already is part of the collection interface: it is spelled __nonzero__ > (Python 2) or __bool__ (Python 3), and like all dunder methods, it is > called automatically for you when you use the right syntax: You're still ignoring what I actually said. -- Devin