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!newsfeed1.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.034 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.01; 'string.': 0.05; 'operand': 0.09; 'python': 0.11; '[4]:': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'string,': 0.24; 'header:In-Reply-To:1': 0.27; 'character': 0.29; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; '13,': 0.31; 'received:google.com': 0.35; 'false': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'first': 0.61; '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=7VLEDPoeyNcA4ED+DpHaKLm4lq0bqIavf+slAmLyjoQ=; b=oxh1q6nRB3pjosSVHIEarRTMK7w+CFZ3NwzsuUAaJI2iQ2cni2Xp6l1oHcB8fzvTlz NdpJRFIhTtWG2lW+pA6sYeBKtu9AvFXC+PzQpKhR9Jt3M8PwV5ATAoqASftC/G549GmC x4KogBuiplE9jVIeBFt7Bp4gFNvIxRgsSq0qe4Rabw+KL/EGhtVrulkeEPARQ+tAGJ2s cNKb8i9ZIDOvECrQflsYIyenjSP0EFnDFoJfTCtXTjWTzof2+dG66/guUq06yEjjm1h+ 4BQKllHEKUtlcj/X0DPmm1/anlm0RJIgc1kwonq6TnpN+kEW+vCzxZFTunMUMMVesouJ /QIQ== MIME-Version: 1.0 X-Received: by 10.52.117.16 with SMTP id ka16mr9019757vdb.43.1371098341500; Wed, 12 Jun 2013 21:39:01 -0700 (PDT) In-Reply-To: <51b94c2b.a266440a.0842.fffffa1d@mx.google.com> References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> <51b926a3$0$29997$c3e8da3$5496439d@news.astraweb.com> <51b94c2b.a266440a.0842.fffffa1d@mx.google.com> Date: Thu, 13 Jun 2013 14:39:01 +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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371098350 news.xs4all.nl 16002 [2001:888:2000:d::a6]:44728 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47895 On Thu, Jun 13, 2013 at 2:35 PM, Kushal Kumaran wrote: > In [4]: 'cd' in s1 or 'cd' in s2 or 'cd' in s3 > Out[4]: False > > In [5]: 'cd' in s1+s2+s3 > Out[5]: True That's why I said it works for *character* in string, not *string* in string. If your first operand is a single character (which in Python is still of type 'str'), then the equivalency holds. ChrisA