[issue2650] re.escape should not escape underscore

Russ Cox report at bugs.python.org
Thu Apr 24 14:38:30 CEST 2008


Russ Cox <rsc at swtch.com> added the comment:

> The loop in escape should really use enumerate 
> instead of "for i in range(len(pattern))".

It needs i to edit s[i].

> Instead of using a loop, can't the test just
> use "self.assertEqual(re.esacpe(same), same)?" 

Done.

> Also, please add tests for what re.escape should escape.

That's handled in the existing test over all bytes 0-255.

Added file: http://bugs.python.org/file10084/re.patch

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2650>
__________________________________


More information about the Python-bugs-list mailing list