changed re.SREPattern mixins (forgot the params everywhere)

This commit is contained in:
David Halter
2012-12-22 18:33:16 +01:00
parent 60c65596d4
commit da6186618e

View File

@@ -37,14 +37,14 @@ def compile():
groups = 0 groups = 0
pattern = 'a' pattern = 'a'
def findall(self): def findall(self, string, pos=None, endpos=None):
""" """
findall(string[, pos[, endpos]]) --> list. findall(string[, pos[, endpos]]) --> list.
Return a list of all non-overlapping matches of pattern in string. Return a list of all non-overlapping matches of pattern in string.
""" """
return ['a'] return ['a']
def finditer(self): def finditer(self, string, pos=None, endpos=None):
""" """
finditer(string[, pos[, endpos]]) --> iterator. finditer(string[, pos[, endpos]]) --> iterator.
Return an iterator over all non-overlapping matches for the Return an iterator over all non-overlapping matches for the
@@ -53,7 +53,7 @@ def compile():
""" """
yield SRE_Match(self) yield SRE_Match(self)
def match(self): def match(self, string, pos=None, endpos=None):
""" """
match(string[, pos[, endpos]]) --> match object or None. match(string[, pos[, endpos]]) --> match object or None.
Matches zero or more characters at the beginning of the string Matches zero or more characters at the beginning of the string
@@ -61,10 +61,10 @@ def compile():
""" """
return SRE_Match(self) return SRE_Match(self)
def scanner(self): def scanner(self, string, pos=None, endpos=None):
pass pass
def search(self): def search(self, string, pos=None, endpos=None):
""" """
search(string[, pos[, endpos]]) --> match object or None. search(string[, pos[, endpos]]) --> match object or None.
Scan through string looking for a match, and return a corresponding Scan through string looking for a match, and return a corresponding
@@ -72,14 +72,14 @@ def compile():
""" """
return SRE_Match(self) return SRE_Match(self)
def split(self): def split(self, string, maxsplit=0]):
""" """
split(string[, maxsplit = 0]) --> list. split(string[, maxsplit = 0]) --> list.
Split string by the occurrences of pattern. Split string by the occurrences of pattern.
""" """
return ['a'] return ['a']
def sub(self): def sub(self, repl, string, count=0):
""" """
sub(repl, string[, count = 0]) --> newstring sub(repl, string[, count = 0]) --> newstring
Return the string obtained by replacing the leftmost non-overlapping Return the string obtained by replacing the leftmost non-overlapping
@@ -87,7 +87,7 @@ def compile():
""" """
return '' return ''
def subn(self): def subn(self, repl, string, count=0):
""" """
subn(repl, string[, count = 0]) --> (newstring, number of subs) subn(repl, string[, count = 0]) --> (newstring, number of subs)
Return the tuple (new_string, number_of_subs_made) found by replacing Return the tuple (new_string, number_of_subs_made) found by replacing