Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'python,': 0.02; 'merging': 0.09; 'works.': 0.09; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'kitchen': 0.16; 'means:': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'fine': 0.24; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; '13,': 0.31; "d'aprano": 0.31; 'steven': 0.31; '"the': 0.34; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'box,': 0.64; 'cupboard': 0.84; 'subject:gets': 0.84; '2013': 0.98 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=p1mVItKEdswzbYMHDAQB+nWmi87aCWHlzupE1QFcpvo=; b=SNCc2lTY3PCtLM7VKNjK7ANZLDx1hnyaWh5eXxNquAw7eewgVzoMQKOGjBbvoTDPp/ InQVRD5he3Z71QFlGkCELYdgyrhwHF9WJ2O1c0tighxUe1kWLQ127mzmZ8gRa5JzGZT0 HRD8aljYthbxQU/6CO4Y+VaN5pimNzqmTBIqrg/CjTOwC4S3+enNHpt7JG6YRpPclqZg X2AGmfGuk/l4HFJUZ3354KpP/ygQIjOnBtQM7ACbri621uKEa4dZjotDgjRQTJFY7OWg XXradEbwiWtAEN64Ajv1WtaFl7iXdSxfOhIuOT2qImZ0jTPoPzC80PY94S+NR/cCOL/E v8vg== MIME-Version: 1.0 X-Received: by 10.220.109.66 with SMTP id i2mr10633580vcp.51.1371089033388; Wed, 12 Jun 2013 19:03:53 -0700 (PDT) In-Reply-To: <51b926a3$0$29997$c3e8da3$5496439d@news.astraweb.com> References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> <51b926a3$0$29997$c3e8da3$5496439d@news.astraweb.com> Date: Thu, 13 Jun 2013 12:03:53 +1000 Subject: Re: A certainl part of an if() structure never gets executed. 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.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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371089041 news.xs4all.nl 15940 [2001:888:2000:d::a6]:57580 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47885 On Thu, Jun 13, 2013 at 11:55 AM, Steven D'Aprano wrote: > In English: > > "the cat is in the box or the cupboard or the kitchen" > > means: > > "the cat is in the box, or the cat is in the cupboard, or the cat is in > the kitchen". > > > But that is not how Python works. In Python, you have to say: > > cat in box or cat in cupboard or cat in kitchen Or you can deem that there be one single location that is the merging of box, cupboard, and kitchen, and say: cat in (box+cupboard+kitchen) which works fine for character-in-string and element-in-list searches. ChrisA