Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.134.4.91.MISMATCH!news2.euro.net!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'versions.': 0.07; '22,': 0.09; 'received:mail-vc0-f174.google.com': 0.09; "wouldn't": 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'spacing': 0.16; 'subject:fails': 0.16; 'subject:when': 0.16; 'time).': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'typing': 0.17; 'version.': 0.17; 'examples': 0.18; 'appropriate': 0.20; 'trying': 0.21; 'not,': 0.21; 'smallest': 0.22; 'visible': 0.22; 'example': 0.23; 'work.': 0.23; 'changes,': 0.23; 'kevin': 0.23; 'patch': 0.24; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'values': 0.26; 'am,': 0.27; 'important.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; 'went': 0.28; 'subject:/': 0.28; 'post': 0.28; 'received:209.85.220.174': 0.29; 'case,': 0.29; 'read,': 0.29; 'that.': 0.30; 'code': 0.31; 'problem.': 0.32; 'submitting': 0.32; 'info': 0.32; 'docs': 0.33; 'problem': 0.33; 'to:addr :python-list': 0.33; 'version': 0.34; 'changed': 0.34; 'received:google.com': 0.34; 'nov': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'next': 0.35; 'but': 0.36; 'url:org': 0.36; 'possible': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'list,': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'your': 0.60; 'back': 0.62; 'different': 0.63; 'more': 0.63; 'directly.': 0.78; 'replicate': 0.84; 'subject:else': 0.84 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=g6Hrfcx2GC2R7tBc9f3q188BpDrAOjsbopM9xudesE8=; b=AE5OSrn7Pm07MR338/8kxxkeuNU/bI3wlNvpWscqNWvKokCw6hjrQQDlLrdKrStId3 5yAaq2yBxCd9WtoMWbANKoeQ2ZLRfbgibduW7u4rIYDxlXwT0IlusK0KAyUnDj1f3+4x 39AhlYimlCG6gN/gHXnReGhgkPYxkixgxOs6u9qzN6KpNLHzmSqf7we7HBbmU6+V/iNq t83rCenwkJkyAD+5RNzeLvFLf3cp8tjMV9+gb0mkHDUYYAhFma7Gwpp1i2dQqlJTxY+a 4UiJ47oIc98S9xvx5zTHVwMb74pfhSXkIprBQsylFhbbeezMoUJrU096YsJTOdc88zTW WBQA== MIME-Version: 1.0 In-Reply-To: <2930dc36-9d8f-411d-aa7a-272fe4885ec5@i5g2000yqh.googlegroups.com> References: <50aadbe6$0$29983$c3e8da3$5496439d@news.astraweb.com> <50aadcf0$0$29983$c3e8da3$5496439d@news.astraweb.com> <2930dc36-9d8f-411d-aa7a-272fe4885ec5@i5g2000yqh.googlegroups.com> Date: Thu, 22 Nov 2012 16:00:46 +1100 Subject: Re: re.search when used within an if/else fails 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353560449 news.xs4all.nl 6910 [2001:888:2000:d::a6]:51089 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33785 On Thu, Nov 22, 2012 at 3:41 AM, Kevin T wrote: > I went back and tried version a again, blam it is/does work now ?!?!? > I am not sure what changed but version a was the original code that > wouldn't work. All the examples i had read, showed version a as a > working version. I spent significant time trying version a with > parens, spacing changes, different regex values to no avail. hence > the creation of all the other versions. This is why the Short, Self-Contained, Correct Example is so important. See http://sscce.org/ for some info on that. I often find myself stuck, begin typing up a post to some appropriate mailing list, and while coalescing the problem into its smallest possible form, end up finding the cause directly. More often than not, I end up discarding the message unsent (though sometimes, I end up submitting a patch to the language/library maintainers, eg improving the docs so it's more visible next time). In any case, if you can copy and paste the exact code and error, it's a lot easier for us to replicate your problem. ChrisA