Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3a.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.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:not': 0.03; 'subject:two': 0.07; 'logic': 0.09; 'subject:None': 0.09; 'boolean': 0.16; 'chip': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'right:': 0.16; 'roy': 0.16; 'similarly,': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'certain': 0.27; 'header:In-Reply- To:1': 0.27; 'quickly': 0.29; "i'm": 0.30; 'easier': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'stuff': 0.32; 'building': 0.35; 'there': 0.35; 'leads': 0.36; 'like,': 0.36; 'useful': 0.36; 'so,': 0.37; 'clear': 0.37; 'minimum': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'helps': 0.61; 'digital': 0.61; "you're": 0.61; 'high': 0.63; 'design.': 0.68; 'smith': 0.68; 'article': 0.77; 'glad': 0.83; 'low': 0.83; '"active': 0.84; '"not': 0.84; 'discrete': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=eZmzft0H c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=tLkI8qN_j18A:10 a=PAN0amn4UiIA:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=RA7hJJdoAAAA:8 a=kZ7UWmmPAAAA:8 a=Roit8xydIFV7A1FpN-cA:9 a=QEXdDO2ut3YA:10 a=pyH5b1fOeEsA:10 X-AUTH: mrabarnett:2500 Date: Sun, 30 Mar 2014 14:58:11 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: checking if two things do not equal None References: <0245aca0-c6b7-493a-aa52-2c3ef6462dbd@googlegroups.com> <5337195f$0$29994$c3e8da3$5496439d@news.astraweb.com> <53377b9e$0$29994$c3e8da3$5496439d@news.astraweb.com> <308493ad-d904-4897-8d7d-6f7780a6bb7d@googlegroups.com> <5337b4e4$0$29994$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396187898 news.xs4all.nl 2921 [2001:888:2000:d::a6]:50427 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69389 On 2014-03-30 13:21, Roy Smith wrote: > In article <5337b4e4$0$29994$c3e8da3$5496439d@news.astraweb.com>, > Steven D'Aprano wrote: > >> I think Johannes got it right: boolean logic is easier to reason about >> when there is a minimum of "not"s. > > I used to do a lot of digital logic design. In certain logic families, > it's easier to build a NAND gate than an AND gate (and similarly, NOR is > easier than OR). This leads to lots of inverted logic. Adding to the > confusion, many designs would use "active low" logic, which means a 1 > was represented by a low voltage, and a 0 by a high voltage. So, you > quickly end up with gibberish like, "not active low clear nand not > active low enable clock". I'm glad I don't do that stuff any more. > When you're building with discrete logic chips, NAND gates are useful because you can use them as inverters too, which helps to keep the chip count down.