Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '2.7': 0.05; 'distinction': 0.07; 'type,': 0.07; 'python': 0.07; 'imo.': 0.09; 'pm,': 0.11; 'received:74.125.82.174': 0.12; 'received:mail- wy0-f174.google.com': 0.12; 'wrote:': 0.14; 'library': 0.15; 'boolean': 0.16; 'docs.': 0.16; 'finney': 0.16; 'ideally,': 0.16; 'subject:() ': 0.16; 'subject:function': 0.16; '\xc3\xa9crit': 0.16; '16,': 0.16; 'url:blog': 0.18; 'call.': 0.19; 'describes': 0.19; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'cheers,': 0.20; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'convert': 0.22; 'values': 0.23; 'referring': 0.23; 'skip:\xe2 20': 0.23; 'subject:code': 0.23; 'linked': 0.25; 'equivalent': 0.26; "i'm": 0.26; 'chris': 0.27; 'function': 0.27; 'message- id:@mail.gmail.com': 0.28; "doesn't": 0.28; 'testing': 0.28; '"the': 0.28; 'sat,': 0.29; 'seem': 0.30; 'cc:addr:python.org': 0.31; 'performs': 0.31; 'operations': 0.33; "isn't": 0.34; 'reference': 0.34; 'uses': 0.34; 'using': 0.34; 'skip:" 10': 0.34; 'question': 0.35; 'rather': 0.36; 'apr': 0.38; 'received:google.com': 0.38; 'no.': 0.38; 'used': 0.38; 'would': 0.40; 'header:Received:5': 0.40; 'necessarily': 0.40; '2011': 0.62; 'truth': 0.65; '16/04/2011': 0.84; 'candide': 0.84; 'pedantic,': 0.84; 'no:': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:cc:content-type :content-transfer-encoding; bh=lj01nuAlmNC8LtBXqrn8HPBHJkSsR/RS3LQfsAibHKM=; b=F2l8KcfALNVakz479d1QjL35YhdUxMIV0EW6XuGYYSqtDKKxSgwx14ql3viLEGoMST i1QknU3iSqe3Ev4xJ5HvRZNsAjU02ElsftPtJ05fbk9ClaVwRoFzYyQJ07tvMhNWawT+ IeSNu7MJ5Bhvo496RQO+ADrenjJ8oUXt8GvXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:cc:content-type :content-transfer-encoding; b=EP1F/ldOE1x4Z02jXOlEmrEkiLhUwIKXxsf1X08Oss6M6i+/4+zyQrOF35hbK4EFHT 5+E9RcPFdJYQjDBxqvBvGYyifHHtMn/YSllzGObo6ADrk7T3x5Ste1crEp2TENyUNRRm RblBc/Zczoj5XdAkQ9mff7sNibitAEaH8s0I0= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: <4daa2b72$0$32037$426a74cc@news.free.fr> References: <4da9fb0b$0$13696$426a74cc@news.free.fr> <87k4etho6e.fsf@benfinney.id.au> <4daa2b72$0$32037$426a74cc@news.free.fr> Date: Sat, 16 Apr 2011 17:16:47 -0700 X-Google-Sender-Auth: WYbXQUZVE1Vj8_1hi_kwzfw2vck Subject: Re: Equivalent code to the bool() built-in function From: Chris Rebert Cc: python-list@python.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 34 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302999409 news.xs4all.nl 65870 [::ffff:82.94.164.166]:44911 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3361 On Sat, Apr 16, 2011 at 4:51 PM, candide wrote: > Le 16/04/2011 23:38, Ben Finney a =C3=A9crit : > >> So the answer to the OP's question is no: the function isn't equivalent >> to the type, > > Can bool() type and bool_equivalent() function return different values ? No. The distinction being drawn is rather pedantic, IMO. >> because the OP's =E2=80=98bool_equivalent=E2=80=99 function necessarily >> uses the built-in =E2=80=98bool=E2=80=99 type, while the reverse is not = true. > > The documentation doesn't seem to state it performs this call. This is why I used the qualifiers "the equivalent of" and "conceptually". > I'm referring to > -- =C2=A75.10 Boolean operations in Document Reference Python 2.7 > -- bool()'s description in Library Reference "bool([x]) Convert a value to a Boolean, using the standard truth testing procedure." > -- =C2=A75.1 Truth Value Testing in Library Reference This describes "the standard truth testing procedure". Ideally, this section would be linked to in bool()'s docs. Cheers, Chris -- http://blog.rebertia.com