Before 1.6a3, should the sre module be turned on, replacing re? That way it'll start getting tested; better we find problems sooner rather than later... --amk
Before 1.6a3, should the sre module be turned on, replacing re? That way it'll start getting tested; better we find problems sooner rather than later...
That would be nice. If I replace re.py with "from sre import *" and run test_re.py, I grt in trouble in the sub() test: $ ./python ../Lib/test/test_re.py Running tests on re.search and re.match Running tests on re.sub Traceback (most recent call last): File "../Lib/test/test_re.py", line 41, in ? assert re.sub(r'\d+', bump_num, '08.2 -2 23x99y') == '9.3 -3 24x100y' File "./../Lib/sre.py", line 35, in sub return _compile(pattern).sub(repl, string, count) File "./../Lib/sre.py", line 84, in _sub return _subn(pattern, template, string, count)[0] File "./../Lib/sre.py", line 114, in _subn return string[:0].join(s), n TypeError: sequence item 0 not a string $ It appears that the value of s is a list containing alternating zeros and strings: [0, '.', 0, ' -', 0, ' ', 0, 'x', 0, 'y']. No time to look into this further, but it could be a bug in sre._subn(). --Guido van Rossum (home page: http://www.python.org/~guido/)
On Sun, Jun 18, 2000 at 03:47:22PM -0500, Guido van Rossum wrote:
No time to look into this further, but it could be a bug in sre._subn().
It's a typo; fixed. However, test_re then runs into the fact that _expand(), which should expand escapes in the replacement string, isn't implemented yet. --amk
<To the tune from "Welcome back Kotter" :-> Welcome back, welcome back, welcome baaaaack - Welcome back, welcome back, welcome baaaaack Good to see you return. Im sure you had a wonderful time! From all accounts, your wedding was beautiful, as Im sure your honeymoon was... Now-were-just-waiting-for-the-baby-announcements-ly, Mark.
-----Original Message----- From: python-dev-admin@python.org [mailto:python-dev-admin@python.org]On Behalf Of Guido van Rossum Sent: Monday, 19 June 2000 6:47 AM To: akuchlin@mems-exchange.org Cc: python-dev@python.org Subject: Re: [Python-Dev] Turning on sre?
[Mark Hammond]
... Good to see you return. Im sure you had a wonderful time! From all accounts, your wedding was beautiful, as Im sure your honeymoon was...
Now-were-just-waiting-for-the-baby-announcements-ly,
Guido & Kim just spent the last night of their honeymoon with Uncle Timmy (who is now living in a Virginia motel room), and I can assure you no babies were made by any pair of us tonight. Unless Guido is quicker than he looks. i'm-certainly-not-ly y'rs - tim
amk wrote:
Before 1.6a3, should the sre module be turned on, replacing re? That way it'll start getting tested; better we find problems sooner rather than later...
in addition to the typo you noticed, there's a backtracking (I think) problem that affects xmllib.py and tokenize.py... I'm working on it. </F>
participants (6)
-
A.M. Kuchling
-
Andrew Kuchling
-
Fredrik Lundh
-
Guido van Rossum
-
Mark Hammond
-
Tim Peters