Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: Equivalent code to the bool() built-in function Date: Mon, 18 Apr 2011 12:12:29 +1200 Lines: 14 Message-ID: <911dvfF6ocU1@mid.individual.net> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net HpkVDVI+ySBxHyoeXhtXEgNIt8t7Xb/Y6pPuAcknQzEDGPaQl2 Cancel-Lock: sha1:q0IgjNAQKyU/iaNhiMCdUE2rAk8= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3440 Chris Angelico wrote: > Well, of course you can always implement bool as an int; Which Python used to do once upon a time -- and still does in a way, because bool is a subclass of int. The bool type was added mainly to provide a type that prints out as 'True' or 'False' rather than 1 or 0. This can be a considerable help for debugging and keeping the conceptual meaning of one's data clear. -- Greg