Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'false,': 0.07; 'subject:code': 0.07; 'python': 0.09; 'notation': 0.09; 'sql,': 0.09; 'sat,': 0.15; 'algebra,': 0.16; 'boolean': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sortable': 0.16; 'sorting': 0.16; 'wrote:': 0.17; 'instance,': 0.17; 'code,': 0.18; 'followed': 0.20; 'received:209.85.214.174': 0.21; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; "d'aprano": 0.29; 'steven': 0.29; 'maybe': 0.29; 'true.': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'false': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'detail': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'jul': 0.65; 'answer.': 0.71; 'actually,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=vBKBmKW+4B7JBN4zmasX7FpLnKX9TOp5QAVYmCXmvMU=; b=sv/mZ+ZUWPEYWEv2M6XD96kvisLzenCWaDsv8VcJ8yPYfXY5OLCCX15unIFABhIxzy LlIpqXzL8NZESCu4U95UAB9asq+AnZqMwlaxUprPOlcTN/K95Wpc4cdVmEpqoDc/rZi3 eD1lTGMLN9TgsaYApuB6CXAOol+Y4R7aks3iIMnyWbGGD0d0QS4UiX0TDCkVF9IMeAoc dQ0JeP2QZLCBaj/ucE8XweRGi1JaISD5nw5HjGSlIg6M4zxOppH22bPnuBmYKG+dnY7A nyGGyLMwgO3ajsbQ8fH1dsQnve/+EhzscwlDnJ8UaxiiNEIWZAJ5sGLvD8/Y2obHRqTH NdTw== MIME-Version: 1.0 In-Reply-To: <500038f5$0$29965$c3e8da3$5496439d@news.astraweb.com> References: <4ff0f8e0$0$29988$c3e8da3$5496439d@news.astraweb.com> <500038f5$0$29965$c3e8da3$5496439d@news.astraweb.com> Date: Sat, 14 Jul 2012 01:36:47 +1000 Subject: Re: code review From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342193811 news.xs4all.nl 6850 [2001:888:2000:d::a6]:35292 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25266 On Sat, Jul 14, 2012 at 1:04 AM, Steven D'Aprano wrote: > Actually, no. Is True less than False, or is it greater? In boolean > algebra, the question has no answer. It is only an implementation detail > of Python that chooses False < True. Maybe in boolean algebra, but in code, it's handy to have sortable bools. In SQL, for instance, I can use a boolean in an ORDER BY, perhaps followed by another criterion, and it's effectively sorting by "1 if some_boolean else 0" or in C notation "some_boolean ? 0 : 1" ChrisA