Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: Operator Precedence/Boolean Logic Date: Wed, 22 Jun 2016 10:10:38 -0400 Lines: 16 Message-ID: References: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> <1466604638.4113235.645273577.469F2790@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de KaPmV3yiVqC0iUdeveGCLw5RhS4L37/WmL6k1q+gGbPw== 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; 'true,': 0.04; '21,': 0.07; 'false.': 0.07; 'true)': 0.07; 'received:internal': 0.09; 'separately': 0.09; '"or"': 0.16; 'expression.': 0.16; 'false:': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'header:In-Reply-To:1': 0.24; 'rest': 0.26; 'compare': 0.27; 'subject:/': 0.30; 'true.': 0.33; 'tue,': 0.34; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'there,': 0.37; 'wanted': 0.37; 'received:66': 0.38; 'to:addr:python.org': 0.40; 'header:Message-Id:1': 0.61; 'elizabeth': 0.72; 'evaluate': 0.72; 'construct': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=SoRgNZLeSXxIWsfFTiF/z+BvwqU=; b=IM5fSg RtTfVaroV9ZXTsaKgHSX0D2c0UbfUXy8JllK0oDDH15n4YbuM8kefkZ1GxdL6MxO z8AXdUwTnHuJvqB+1r/EXbGSO6UpDAaNBRvUDwKUxx7XKDVrsnAJSdF+27svoxQD ++FNo5T7Oz1UuUgzm2x0KUtYU5/UoCxdf/Og0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=SoRgNZLeSXxIWsf FTiF/z+BvwqU=; b=eOQk3dTd92tFxh3OXx/UWTt0EyIhNJ12W/oKYWvuI6HFtpI MBCPGFFHEn/bZIhDDmxm66YkbS+gDOnMj3OhFKImy+uk81bMwMSWnSVy2tsNUeEn JZNH5kQQjT8BwH+pI62nhrifIMgGnOXD+knZHVOX/u+oKsYO+QOq5OB8z9qk= X-Sasl-Enc: WOQ58Sx71qsBH1wacyBAkWJT8rjbSlwzK74SxgrCQkdx 1466604638 X-Mailer: MessagingEngine.com Webmail Interface - ajax-9635f794 In-Reply-To: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1466604638.4113235.645273577.469F2790@webmail.messagingengine.com> X-Mailman-Original-References: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> Xref: csiph.com comp.lang.python:110315 On Tue, Jun 21, 2016, at 23:40, Elizabeth Weiss wrote: > Hi There, > > I am a little confused as to how this is False: > > False==(False or True) > > I would think it is True because False==False is true. "False or True" is True, and then it reduces to "False == True" which is false. There's no "x == (y or z)" construct to compare x separately to both y and z, the "or" will evaluate to the first one that's true and then is used in the rest of the expression. If you wanted to write "x == y or x == z" with only a single x, you'd do "x in (y, z)".