[issue7940] re.finditer and re.findall should support negative end positions

2013-05-23 Thread Mark Lawrence
Mark Lawrence added the comment: Has this been fixed in the regex module? -- nosy: +BreamoreBoy ___ Python tracker ___ ___ Python-bugs-

[issue7940] re.finditer and re.findall should support negative end positions

2013-05-23 Thread Matthew Barnett
Matthew Barnett added the comment: Yes. As msg99456 suggests, I fixed it the my source code before posting. Compare re in Python 3.3.2: >>> re.compile('x').findall('', 1, 3) ['x', 'x'] >>> re.compile('x').findall('', 1, -1) [] with regex: >>> regex.compile('x').findall('', 1, 3) [

[issue7940] re.finditer and re.findall should support negative end positions

2013-05-25 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- components: +Library (Lib) stage: test needed -> needs patch versions: +Python 3.4 -Python 2.7, Python 3.2 ___ Python tracker ___ __

[issue7940] re.finditer and re.findall should support negative end positions

2013-05-25 Thread Matthew Barnett
Matthew Barnett added the comment: I've attached a patch. -- keywords: +patch Added file: http://bugs.python.org/file30377/issue7940.patch ___ Python tracker ___ _

[issue7940] re.finditer and re.findall should support negative end positions

2013-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm worrying about backward compatibility. See also issue7951. -- nosy: +serhiy.storchaka ___ Python tracker ___ __

[issue7940] re.finditer and re.findall should support negative end positions

2013-05-26 Thread Matthew Barnett
Matthew Barnett added the comment: Like the OP, I would've expected it to handle negative indexes the way that strings do. In practice, I wouldn't normally provide negative indexes; I'd use some string or regex method to determine the search limits, and then pass them to finditer and findall,