There's a new version of the patch http://www.python.org/sf/757624 I understood there was some problems with the first implementation, and changed some aspects of how the new implementation works to fix them. This new implementation is more complex than the other implementations (mine, and the original), given the many details it covers, but is probably faster than these implementations in all situations (tests very welcome). Additionally, it introduces new features like infinite loop protection (*matching* the REs, not preventing their use). Here is a list of valid REs not accepted by the original implementation, and gracefully working on the new implementation (these used to blow up SRE with an infinite loop, not because the implementation was recursive). re.match("(a?)+ab", "ab") re.match("^(a|b?)+a$", "a") re.match("(a*)+?ac", "ab") re.match("((a)*)+?ac", "ab") re.match("(?=a)*", "a") Here is a list of unusual REs I've built while I was understanding how complex the operations could be. All of them work. re.search('(.*?)(?http://niemeyer.net
There's a new version of the patch
http://www.python.org/sf/757624
I understood there was some problems with the first implementation, and changed some aspects of how the new implementation works to fix them.
BDFL Pronouncement: let's not add this to the 2.3 release. We can add it to CVS after 2.3 is out the door and it will be included in the 2.3 release. You were so convinced that everything was right (after all, the tests passed :-), and now you're admitting there were still problems. So prudence requires me to assume that there will be more problems, because the new version is more complicated than the previous one. --Guido van Rossum (home page: http://www.python.org/~guido/)
There's a new version of the patch
http://www.python.org/sf/757624
I understood there was some problems with the first implementation, and changed some aspects of how the new implementation works to fix them.
BDFL Pronouncement: let's not add this to the 2.3 release. We can add it to CVS after 2.3 is out the door and it will be included in the 2.3 release.
You were so convinced that everything was right (after all, the tests passed :-), and now you're admitting there were still problems. So
Unfortunately, I was wrong. Some tests in re_tests were failing, and I couldn't see that until I've fixed the two tests in test_re.py that failed *expecting* the recursion explosion (that's something we have to change, making re_tests.py run even if some test fails in test_re.py). Btw, I was not convinced everything was right, I was convinced the implementation was simple enough, and it was ready to be tested further, and that we could go back easily until 2.3, as you probably remember.
prudence requires me to assume that there will be more problems, because the new version is more complicated than the previous one.
That's why I've sent the message and asked for testers, without committing the code. I understand your position, and agree partially. The only point that makes me wonder if it wouldn't be nice to try adding this to 2.3 is that many bugs were fixed by this implementation, besides the recursion problem. Anyway, I'll keep working on it, and testing it, being on 2.3 or not. -- Gustavo Niemeyer http://niemeyer.net
participants (2)
-
Guido van Rossum
-
Gustavo Niemeyer