[Python-Dev] Regexp 2.7

Jared Grubb jared.grubb at gmail.com
Tue Mar 10 20:52:25 CET 2009


I'm not criticizing the current battery of tests, nor am I arguing  
that we replace them.

There's a comment in the test_re.py that says that "these tests were  
carefully modeled to cover most of the code"... That is a very  
difficult statement to maintain and/or verify, especially if the  
library gets a major revision (which it appears the original post's  
patch is).

PCRE has _thousands_ of detailed regular expression tests, testing  
everything from matching to parsing to extended regular expression  
syntax to encoding and locales. (It's been a while since I've looked  
at the details, but of course there are tests that dont apply to  
Python's implmentation.)

So, if there's interest in investigating how much of the PCRE tests  
can augment the existing tests, I am offering to do so. (I already did  
a simple translation utility to parse the PCRE test format into  
something we could use in the PyPy test suite; I could try to do  
something similar for test_re, if there's interest).

Jared

On 10 Mar 2009, at 11:32, Guido van Rossum wrote:

> Hm, what's wrong with the existing set of regex test cases? This is
> one of the most complete set of test cases in our test suite.
>
> On Tue, Mar 10, 2009 at 11:08 AM, Jared Grubb  
> <jared.grubb at gmail.com> wrote:
>> Would there be any interest in augmenting the test case library for  
>> the
>> regex stuff?
>>
>> On 9 Mar 2009, at 16:07, Antoine Pitrou wrote:
>>
>>> Facundo Batista <facundobatista <at> gmail.com> writes:
>>>>
>>>>> Matthew Barnett has been doing a lot of work on the regular  
>>>>> expressions engine
>>>>>
>>>>> (it seems he hasn't finished yet) under http://bugs.python.org/issue2636 
>>>>> .
>>>>> However, the patches are really huge and touch all of the sre  
>>>>> internals.
>>>>> I wonder what the review process can be for such patches? Is  
>>>>> there someone
>>>>> knowledgeable enough to be able to review them?
>>>>
>>>> All test cases run ok? How well covered is that library?
>>>
>>> I don't know, I haven't even tried it.
>>>


More information about the Python-Dev mailing list