Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: psss...I want to move from Perl to Python Date: Sun, 31 Jan 2016 07:28:58 -0500 Lines: 26 Message-ID: References: <56ab10f4$0$1606$c3e8da3$5496439d@news.astraweb.com> <8d8e0774-0d25-443c-a466-6ab671bcaf3d@googlegroups.com> <56ad69e4$0$14486$c3e8da3@news.astraweb.com> <53d071aa-0f24-421b-8904-084071c4a8b2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 4ragw3IEZoUgQUIv2z2UcAQI9Ls+a48tSdHjZlxf5SSA== 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; 'subject:Python': 0.05; 'cache': 0.05; 'correct.': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'jan': 0.11; ':-)': 0.12; '100,': 0.16; '2016': 0.16; 'distinct': 0.16; 'gregory': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'wrote:': 0.16; '31,': 0.22; 'parser': 0.22; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'sort': 0.25; 'module': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints- To:1': 0.26; 'used,': 0.27; 'there.': 0.30; 'e.g.': 0.30; 'maybe': 0.33; 'point': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'but': 0.36; 'received:71': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'january': 0.38; 'application': 0.39; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'ever': 0.60; 'real': 0.62; 'sunday': 0.72; '512': 0.84; 'dozens': 0.84; 'utc+5:30,': 0.84; 'received:fios.verizon.net': 0.91; 'subject:want': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-71-185-227-36.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: <53d071aa-0f24-421b-8904-084071c4a8b2@googlegroups.com> 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: , Xref: csiph.com comp.lang.python:102351 On 1/30/2016 10:22 PM, Rustom Mody wrote: > On Sunday, January 31, 2016 at 7:27:06 AM UTC+5:30, Steven D'Aprano wrote: >> On Sunday 31 January 2016 09:18, Gregory Ewing wrote: >> Correct. The re module keeps a cache of the last N regexes used, for some >> value of N (possibly 10?) so for casual use there's no real point to pre- >> compiling other than fussiness. >> >> But if you have an application that makes heavy-duty use of regexes, e.g. >> some sort of parser with dozens of distinct regexes, you might not want to >> rely on the cache. >>>> import re >>>> re._MAXCACHE > 512 >>>> > > Have you ever seen a program that uses 512 re's? > I havent :-) I do not know if the cache was always there. It used to be smaller, maybe 100, then 200. -- Terry Jan Reedy