Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'alignment': 0.07; 'completeness': 0.07; 'python': 0.09; 'received:155': 0.09; 'tab': 0.09; '(python)': 0.16; 'dependent.': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'editor,': 0.16; 'expands': 0.16; 'f.read()': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:169.70': 0.16; 'received:169.70.184': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'securities,': 0.16; 'space)': 0.16; 'subject:fails': 0.16; 'subject:when': 0.16; 'tabs': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'wrote:': 0.17; 'expanded': 0.17; '>>>': 0.18; 'input': 0.18; '(or': 0.18; 'to:name:python-list@python.org': 0.20; '3.x': 0.22; 'received:169.254': 0.24; 'second': 0.24; 'header:In-Reply-To:1': 0.25; 'accuracy': 0.27; 'subject:/': 0.28; 'character.': 0.29; 'concern': 0.29; 'editors': 0.29; 'spaces': 0.29; 'convert': 0.29; 'received:169': 0.29; 'source': 0.29; 'header:Received:8': 0.30; 'code': 0.31; 'file': 0.32; 'print': 0.32; 'mixed': 0.33; 'to:addr :python-list': 0.33; 'skip:d 20': 0.34; 'text': 0.34; 'there': 0.35; 'next': 0.35; 'but': 0.36; 'anything': 0.36; 'charset:us- ascii': 0.36; 'editor': 0.37; 'does': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'space': 0.39; 'your': 0.60; 'first': 0.61; 'helps': 0.63; 'information,': 0.63; 'url:email': 0.63; 'show': 0.63; 'confirm': 0.64; 'legal': 0.65; 'due': 0.66; 'subject': 0.66; 'purchase': 0.67; 'believe': 0.69; 'eight': 0.71; 'sale': 0.76; 'received:169.254.8': 0.84; 'subject:else': 0.84; 'visually': 0.84; 'dennis': 0.91 X-DKIM: OpenDKIM Filter v2.1.3 sf3.jpmchase.com qATMrRQK032061 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1354229607; bh=RfNdc9uphLIFNJtUxl3+naSWdW/2Md7H8jPzHyF5RQw=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=ZP0C6Db+ga9dau2ydIkTRk04jheU0JH7EB9/aeHqdkl0JGOg1ze5FSozT9rsxrnZX FhMH0Mca17m0teWlMeAwe5ndzHFCqwii4Gqu6h9KothpWzBU5ImrxcUWHR0sj+Px2l bxjh3KUvo3WIJjiYCW94/vHKFhGTFmAqAnO1d+j4= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: re.search when used within an if/else fails Thread-Topic: re.search when used within an if/else fails Thread-Index: AQHNzcdZcFFfaT9Fc0qKvMMNsVHKnJgBaOGw Date: Thu, 29 Nov 2012 22:53:20 +0000 References: <2930dc36-9d8f-411d-aa7a-272fe4885ec5@i5g2000yqh.googlegroups.com> <11835b30-3448-45cc-9ae5-46d651f93429@googlegroups.com> <50b68476$0$29994$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.47] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1354230801 news.xs4all.nl 6875 [2001:888:2000:d::a6]:34192 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34081 Dennis Lee Bieber wrote:=0D=0A> =0D=0A> Unless there has been a major chan= ge in the parser=2E=2E=2E (I still don't=0D=0A> have Python 3=2Ex installed= )=0D=0A> =0D=0A> I believe is expanded to 8-spaces -- NOT TO NEXT MU= LTIPLE OF=0D=0A> 8=2E=2E=2E=0D=0A=0D=0AA tab is *one* character=2E Your *ed= itor* may show tabs visually =0D=0A"expanded" or convert them to spaces=2E = This is entirely editor dependent=2E =0D=0AMy current (python) editor, does= expands tabs to the next *multiple* of 4=2E =0D=0AIt helps keep code align= ed, and I have no need for 4 hard spaced tabs =0D=0Awithout regards to alig= nment (yet)=2E I have had editors that did 4 hard =0D=0Aspaced tabs, so it = might be a developer/application preference=2E=0D=0A=0D=0A>>> with open(r'c= :\ramit\mix_tab_space=2Etxt')as f:=0D=0A=2E=2E=2E d =3D f=2Eread()=0D= =0A=2E=2E=2E=0D=0A>>> print repr(d)=0D=0A'\tblah\n test\n\t'=0D=0A>>> pr= int d[0] + 'goo'=0D=0A goo=0D=0A>>> print repr(d[0] + 'goo')=0D=0A'\tgoo'= =0D=0A=0D=0A> =0D=0A> So the first is 8+4 =3D> 12 spaces, the second is 2+= 8+4 =3D> 14 spaces=2E=0D=0A> =0D=0A> Does 2 + + 2 vs 4 + vs + 4 succeed? That would=0D=0A> confirm the treatment=2E=0D=0A> =0D=0A> = The main concern with mixed tab and spaces, as I recall, was due to=0D=0A>= having /editors/ and /terminals/ configured to show as a four=0D=0A>= space (or anything other than an eight space) increment; so visually=0D=0A= > four spaces and one might look the same=2E=2E=2E One user might hav= e the=0D=0A> editor showing 4-space indents on but entering text usin= g 4 spaces=0D=0A> on input -- which now is mis-aligned if the source file H= AD in it=2E=0D=0A=0D=0A=0D=0A~Ramit=0D=0A=0D=0A=0D=0A=0D=0AThis email= is confidential and subject to important disclaimers and=0D=0Aconditions i= ncluding on offers for the purchase or sale of=0D=0Asecurities, accuracy an= d completeness of information, viruses,=0D=0Aconfidentiality, legal privile= ge, and legal entity disclaimers,=0D=0Aavailable at http://www=2Ejpmorgan= =2Ecom/pages/disclosures/email=2E