Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Equivalent code to the bool() built-in function References: <4da9fb0b$0$13696$426a74cc@news.free.fr> <87k4etho6e.fsf@benfinney.id.au> <4daa2b72$0$32037$426a74cc@news.free.fr> <87d3klha85.fsf@benfinney.id.au> <4daaa6f6$0$20187$426a74cc@news.free.fr> <878vv9gqhq.fsf@benfinney.id.au> <4dab7654$0$7290$426a74cc@news.free.fr> X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney Date: Mon, 18 Apr 2011 09:46:35 +1000 Message-ID: <87liz8fnl0.fsf@benfinney.id.au> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:PrJIB0e/E0iTCjQvUqfDrIlnC00= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lines: 20 Organization: Unlimited download news at news.astraweb.com NNTP-Posting-Host: 8ee9dfdc.news.astraweb.com X-Trace: DXC=OWC?\baJhd5hZ4>`7BGPo4L?0kYOcDh@:N7:H2`MmAU3[VV1\5dcZ`:]G;2>V^?kW3bEW9A[5UK?5NZ[SL`C\Kg3^LkNj`52d=? Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3438 candide writes: > Le 17/04/2011 11:46, Ben Finney a écrit : > > What is the “shortcut” you refer to? > > bool(x) is nothing more than a shortcut for the following expression : > True if x else False. We're going around in circles. I've already pointed out that ‘bool(x)’ is what the expression you're talking about will do behind the scenes for the ‘if x’ clause *anyway*. It's bizarre to call that a shortcut. You seem to expect the documentation to be explicit about everything the implementation does. Either that, or you're not making much sense. -- \ “Pray, v. To ask that the laws of the universe be annulled in | `\ behalf of a single petitioner confessedly unworthy.” —Ambrose | _o__) Bierce, _The Devil's Dictionary_, 1906 | Ben Finney