New submission from James Laver:
Traceback (most recent call last):
File "/Users/jlaver/retest.py", line 6, in test_escape
self.assertEquals(re.escape('-'), '-')
AssertionError: '\\-' != '-'
The only place you can do bad things with h
James Laver added the comment:
Quite right, it does say that in the documentation. The documentation is
perfectly correct, but the behaviour is wrong in my opinion and as you suggest,
we should be escaping metacharacters only.
--
___
Python tracker
James Laver added the comment:
I looked up quotemeta with perldoc and you're right, it will quote the hyphen.
Given that python's regex engine correctly deals with unnecessarily quoted
characters, I suppose this is fine.
--
resolution: -> wont fix
status: o