[Python-checkins] cpython (2.7): Issue #12875: explicitly specify default value of the optional 'flags' argument
eli.bendersky
python-checkins at python.org
Fri Nov 11 20:16:06 CET 2011
http://hg.python.org/cpython/rev/02e4d3ebbb02
changeset: 73514:02e4d3ebbb02
branch: 2.7
parent: 73499:369487785e9f
user: Eli Bendersky <eliben at gmail.com>
date: Fri Nov 11 21:25:56 2011 +0200
summary:
Issue #12875: explicitly specify default value of the optional 'flags' argument to re.* functions. Closes #12875
files:
Doc/library/re.rst | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -431,7 +431,7 @@
form.
-.. function:: compile(pattern[, flags])
+.. function:: compile(pattern[, flags=0])
Compile a regular expression pattern into a regular expression object, which
can be used for matching using its :func:`match` and :func:`search` methods,
@@ -521,7 +521,7 @@
b = re.compile(r"\d+\.\d*")
-.. function:: search(pattern, string[, flags])
+.. function:: search(pattern, string[, flags=0])
Scan through *string* looking for a location where the regular expression
*pattern* produces a match, and return a corresponding :class:`MatchObject`
@@ -530,7 +530,7 @@
string.
-.. function:: match(pattern, string[, flags])
+.. function:: match(pattern, string[, flags=0])
If zero or more characters at the beginning of *string* match the regular
expression *pattern*, return a corresponding :class:`MatchObject` instance.
@@ -584,7 +584,7 @@
Added the optional flags argument.
-.. function:: findall(pattern, string[, flags])
+.. function:: findall(pattern, string[, flags=0])
Return all non-overlapping matches of *pattern* in *string*, as a list of
strings. The *string* is scanned left-to-right, and matches are returned in
@@ -599,7 +599,7 @@
Added the optional flags argument.
-.. function:: finditer(pattern, string[, flags])
+.. function:: finditer(pattern, string[, flags=0])
Return an :term:`iterator` yielding :class:`MatchObject` instances over all
non-overlapping matches for the RE *pattern* in *string*. The *string* is
@@ -613,7 +613,7 @@
Added the optional flags argument.
-.. function:: sub(pattern, repl, string[, count, flags])
+.. function:: sub(pattern, repl, string[, count, flags=0])
Return the string obtained by replacing the leftmost non-overlapping occurrences
of *pattern* in *string* by the replacement *repl*. If the pattern isn't found,
@@ -662,7 +662,7 @@
Added the optional flags argument.
-.. function:: subn(pattern, repl, string[, count, flags])
+.. function:: subn(pattern, repl, string[, count, flags=0])
Perform the same operation as :func:`sub`, but return a tuple ``(new_string,
number_of_subs_made)``.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list