diff -r ee5f9615c8a7 Lib/re.py --- a/Lib/re.py Thu Oct 23 22:39:11 2014 +0200 +++ b/Lib/re.py Wed Oct 29 16:58:26 2014 +0100 @@ -168,7 +168,7 @@ def search(pattern, string, flags=0): a match object, or None if no match was found.""" return _compile(pattern, flags).search(string) -def sub(pattern, repl, string, count=0, flags=0): +def sub(pattern, repl, string, *, count=0, flags=0): """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; @@ -177,7 +177,7 @@ def sub(pattern, repl, string, count=0, a replacement string to be used.""" return _compile(pattern, flags).sub(repl, string, count) -def subn(pattern, repl, string, count=0, flags=0): +def subn(pattern, repl, string, *, count=0, flags=0): """Return a 2-tuple containing (new_string, number). new_string is the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in the source @@ -188,7 +188,7 @@ def subn(pattern, repl, string, count=0, return a replacement string to be used.""" return _compile(pattern, flags).subn(repl, string, count) -def split(pattern, string, maxsplit=0, flags=0): +def split(pattern, string, *, maxsplit=0, flags=0): """Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings. If capturing parentheses are used in pattern, then the text of all