Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'explicitly': 0.04; 'msg': 0.07; 'correct,': 0.09; 'wrong,': 0.09; 'subject:search': 0.16; 'time.time()': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'skip:{ 20': 0.17; 'code,': 0.18; 'feb': 0.19; 'code.': 0.20; 'otherwise,': 0.20; 'work.': 0.23; 'demonstrate': 0.23; 'statement': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'guess': 0.27; "doesn't": 0.28; 'subject:/': 0.28; 'actual': 0.28; "d'aprano": 0.29; 'steven': 0.29; 'fri,': 0.30; 'code': 0.31; 'could': 0.32; 'hopefully': 0.33; 'to:addr:python- list': 0.33; 'doing': 0.35; 'pm,': 0.35; 'but': 0.36; 'does': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'show': 0.63; 'making': 0.64; 'useful.': 0.65; 'received:74.208': 0.71; '+1100': 0.84; '2013': 0.84; 'received:74.208.4.194': 0.84; 'subject:via': 0.84 Date: Fri, 08 Feb 2013 01:27:44 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Curious to see alternate approach on a search/replace via regex References: <511319c7$0$21812$c3e8da3$76491128@news.astraweb.com> <51142e96$0$6512$c3e8da3$5496439d@news.astraweb.com> <20130207151326.817b948a2ee2fc9cbb631c35@lavabit.com> In-Reply-To: <20130207151326.817b948a2ee2fc9cbb631c35@lavabit.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:3iPJFZ2Bv11s2FxJTqtDog9M/i6bid4OFqyidqDaWRq AID8jExACc2U/mJD1dL9d+L99puts/q2c6ydl9Lk5UqmQ9feQm 07Y1mEvAcDb2Jgm9VP+Ny4LaxE/hBfGqlFcKyhXI2Kq1xKHAOK 5RccU5l01HUsICQeSsj7TFdj06rHCbIWCBCxOi7+fpMtLbLNyX PkwO6NR6ujXFWGPkdkk9pzggHGV06nJVGP7XQpTLzyp1UaOJJz mqto6DfIdhj6hS/1BYS3Eo+kkovvCSyRLcsbRds1y33xO/wEq6 RKDZtaiJ/XezuSQKaJrObn2RnfOYXPp0J2fUyOrOsB8B2ImMg= = 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360304886 news.xs4all.nl 6944 [2001:888:2000:d::a6]:40336 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38420 On 02/07/2013 06:13 PM, rh wrote: > On Fri, 08 Feb 2013 09:45:41 +1100 > Steven D'Aprano wrote: > >> >> >> But since you don't demonstrate any actual working code, you could be >> correct, or you could be timing it wrong. Without seeing your timing >> code, my guess is that you are doing it wrong. Timing code is tricky, >> which is why I always show my work. If I get it wrong, someone will >> hopefully tell me. Otherwise, I might as well be making up the >> numbers. > > re.compile That statement does explicitly nothing useful. It certainly doesn't compile anything, or call any regex code. > starttime = time.time() > for i in range(numloops): > u2f() > > msg = '\nElapsed {0:.3f}'.format(time.time() - starttime) > print(msg) > -- DaveA