Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4a.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.063 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'alain': 0.09; 'cc:addr :python-list': 0.11; '(either': 0.16; 'ah,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'i.e.,': 0.16; 'subject:search': 0.16; 'wrote:': 0.18; 'meant': 0.20; '>>>': 0.22; 'example': 0.22; 'cc:addr:python.org': 0.22; 'stick': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'chris': 0.29; 'am,': 0.29; 'forgot': 0.30; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'fri,': 0.33; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'false': 0.36; "didn't": 0.36; 'thanks': 0.36; 'should': 0.36; 'quote': 0.39; "you're": 0.61; 'levels': 0.65; '2015': 0.84; 'basics.': 0.84; 'subject:find': 0.84; 'absolutely': 0.87; 'subject:Best': 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=H0AhcfNNFGXm9xyvrJtjLtkFxyrnZgGHHerGCpsthQc=; b=Oamam9JuGtOugRJnEaoo0D++j4XVRrIKqt8UYViMZrvrnv6FIByI3oiGopV9ACoD1d 1zJhkApa/tnGmzefNQc9v/yqkn0N4TC+hLJ9Z/jePCk+ZbDnGzTQKAq8M8pLCpkOTKJd uKk+IpNfYQ8aHxxAiaklWZzWyylEXK4xs+aYlMA3loQu55+vTq0jnPdtwY2zLNGtPsuV xwm+IwgA/Y6QztdQCvg/xZ5k7j17P37iSk6hlfFtowqJAV5fYVTVOB0Tt1L5I1fWHcDc 8Gr0QEFHiHI7MRgAsc2Sddc8NCfWWikbLbMAWXzL/i671hen+71UfixEHIDU06WxIMeM chvg== MIME-Version: 1.0 X-Received: by 10.107.16.32 with SMTP id y32mr43017350ioi.53.1428593762432; Thu, 09 Apr 2015 08:36:02 -0700 (PDT) In-Reply-To: <5526990a$0$12986$c3e8da3$5496439d@news.astraweb.com> References: <2e3a3c01-20b3-4948-9b32-bd80ed46822b@googlegroups.com> <552460cc$0$13002$c3e8da3$5496439d@news.astraweb.com> <876196cm1e.fsf@elektro.pacujo.net> <87k2xlzknu.fsf@elektro.pacujo.net> <8738498qf7.fsf@dpt-info.u-strasbg.fr> <87fv89zd0m.fsf@elektro.pacujo.net> <87y4m1795n.fsf@dpt-info.u-strasbg.fr> <874mopzarw.fsf@elektro.pacujo.net> <87twwp76aj.fsf@dpt-info.u-strasbg.fr> <87pp7d73q8.fsf@dpt-info.u-strasbg.fr> <5526990a$0$12986$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 10 Apr 2015 01:36:01 +1000 Subject: Re: Best search algorithm to find condition within a range 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.20 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428593770 news.xs4all.nl 2824 [2001:888:2000:d::a6]:58767 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88731 On Fri, Apr 10, 2015 at 1:21 AM, Steven D'Aprano wrote: > On Fri, 10 Apr 2015 01:02 am, Chris Angelico wrote: > >> On Fri, Apr 10, 2015 at 12:53 AM, Alain Ketterlin >> wrote: >>> Ouch, you're right, I tried to stick with Marko's example and forgot the >>> basics. I meant "signed ints", but the "removable" condition should be >>> something like: >>> >>> if ( x>0 && y>0 && z>> ... >>> >>> i.e., some condition that is never true (either false or undefined). >>> Thanks for the correction. >> >> Ah, yep. And yes, that's absolutely right - the compiler's allowed to >> treat that as never true. > > Am I missing something? Did you over-trim the quoting? Yes, because the significant line was about three levels of quote back, so I didn't bother to go retrieve it. Immediately before the if: z = x + y; ChrisA