Skip to content

Commit

Permalink
Merge pull request #643 from topazproject/tim/Regexp#quote
Browse files Browse the repository at this point in the history
Alias Regexp#quote to Regexp#escape
  • Loading branch information
alex committed Apr 20, 2013
2 parents 8ad6f07 + e1324bd commit 9da329e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions spec/tags/core/regexp/quote_tags.txt
@@ -1,5 +1,3 @@
fails:Regexp.quote escapes any characters with special meaning in a regular expression
fails:Regexp.quote sets the encoding of the result to US-ASCII if there are only US-ASCII characters present in the input String fails:Regexp.quote sets the encoding of the result to US-ASCII if there are only US-ASCII characters present in the input String
fails:Regexp.quote sets the encoding of the result to the encoding of the String if any non-US-ASCII characters are present in an input String with valid encoding fails:Regexp.quote sets the encoding of the result to the encoding of the String if any non-US-ASCII characters are present in an input String with valid encoding
fails:Regexp.quote sets the encoding of the result to ASCII-8BIT if any non-US-ASCII characters are present in an input String with invalid encoding fails:Regexp.quote sets the encoding of the result to ASCII-8BIT if any non-US-ASCII characters are present in an input String with invalid encoding
fails:Regexp.quote works with symbols
1 change: 1 addition & 0 deletions topaz/objects/regexpobject.py
Expand Up @@ -229,6 +229,7 @@ def method_eqeqeq(self, space, s):
def method_casefoldp(self, space): def method_casefoldp(self, space):
return space.newbool(bool(self.flags & regexp.IGNORE_CASE)) return space.newbool(bool(self.flags & regexp.IGNORE_CASE))


@classdef.singleton_method("quote", string="str")
@classdef.singleton_method("escape", string="str") @classdef.singleton_method("escape", string="str")
def method_escape(self, space, string): def method_escape(self, space, string):
result = [] result = []
Expand Down

0 comments on commit 9da329e

Please sign in to comment.