Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.095 X-Spam-Evidence: '*H*': 0.82; '*S*': 0.01; 'calculating': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; '10:00': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hashable': 0.16; 'ought': 0.16; 'wrote:': 0.18; 'work,': 0.20; 'written': 0.21; 'example': 0.22; 'cc:addr:python.org': 0.22; '31,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'fri,': 0.33; 'could': 0.34; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'wrong': 0.37; 'list': 0.37; 'list,': 0.38; 'supporting': 0.39; 'even': 0.60; 'is.': 0.60; 'first': 0.61; 'more': 0.64; 'as:': 0.81; 'comment.': 0.84; 'suspicion': 0.84; 'subject:Statement': 0.91; 'subject:True': 0.91; 'to:none': 0.92 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:cc :content-type; bh=PyWmWDUTyuNUT0he0pVmRQuU6BejH7Rx4mzbm83jaH8=; b=MOVz/UwNs4O9bvwDQI7VIvTVqh4WOu8rYLo9MsKYtj6+P5H4yNEtCcll9jjTySbyKk x6yJ5XcwE+fObu3vxKY7KoESy+tKzmW9v88SPSYaAUbVuj2qFCfZQIOQdJ6J5QF2w3AS XakBw4Xea/TIPyYmZedLGXIrm5DHh0/jKF0Y6Ab4m5a9Y1zjhc1Qldn85VGaqL4N4Y1J 8cQDXaO8JwMfm1AAdXkiTGrrh77F3C5WY0cIrbphKS4mTubKd6ZiKxRt42TL5TCqRjhs 3ae/+Gpth1HGTAie5FUSPQid/PcKJ1AkXN8psvrV1F6xDZxOZZJqgqYZCK8zM0RS7075 eJrw== MIME-Version: 1.0 X-Received: by 10.68.133.6 with SMTP id oy6mr17118697pbb.153.1391124341356; Thu, 30 Jan 2014 15:25:41 -0800 (PST) In-Reply-To: <5673ebd0-89b6-485c-8ccb-f62bf15f513a@googlegroups.com> References: <5673ebd0-89b6-485c-8ccb-f62bf15f513a@googlegroups.com> Date: Fri, 31 Jan 2014 10:25:41 +1100 Subject: Re: Statement evals as False in my IDE and True elsewhere From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391124349 news.xs4all.nl 2916 [2001:888:2000:d::a6]:41636 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65067 On Fri, Jan 31, 2014 at 10:00 AM, CM wrote: > Essentially, if ALL the items in that list are '[omitted]', I must not process the list, but if even one of them is something other than '[omitted]', I need to process it. Okay. The set example that I gave will work, then - as long as all items are hashable (if they're strings, they are). Up to you which one's more readable. In any case, that could do with a supporting comment. My first suspicion was that it ought to be written as: fake_result = '[omitted]' not in fake_data and that it was calculating the wrong thing. But it is doing what you think it is. ChrisA