summaryrefslogtreecommitdiffstats
path: root/Lib/re.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-01 15:05:06 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-01 15:05:06 (GMT)
commit75edad0502c648148c6139b2d81a128559573c0d (patch)
treefe8dc37189c0d6b147fa7a9a02c75cf1e969a602 /Lib/re.py
parentda10d3b7a5b4c3be5b3bbf0c4cfcd18110a0decd (diff)
downloadcpython-75edad0502c648148c6139b2d81a128559573c0d.zip
cpython-75edad0502c648148c6139b2d81a128559573c0d.tar.gz
cpython-75edad0502c648148c6139b2d81a128559573c0d.tar.bz2
Merged revisions 68116-68119,68121,68123-68127 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68116 | georg.brandl | 2009-01-01 05:46:51 -0600 (Thu, 01 Jan 2009) | 2 lines #4100: note that element children are not necessarily present on "start" events. ........ r68117 | georg.brandl | 2009-01-01 05:53:55 -0600 (Thu, 01 Jan 2009) | 2 lines #4156: make clear that "protocol" is to be replaced with the protocol name. ........ r68118 | georg.brandl | 2009-01-01 06:00:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4185: clarify escape behavior of replacement strings. ........ r68119 | georg.brandl | 2009-01-01 06:09:40 -0600 (Thu, 01 Jan 2009) | 3 lines #4222: document dis.findlabels() and dis.findlinestarts() and put them into dis.__all__. ........ r68121 | georg.brandl | 2009-01-01 06:43:33 -0600 (Thu, 01 Jan 2009) | 2 lines Point to types module in new module deprecation notice. ........ r68123 | georg.brandl | 2009-01-01 06:52:29 -0600 (Thu, 01 Jan 2009) | 2 lines #4784: ... on three counts ... ........ r68124 | georg.brandl | 2009-01-01 06:53:19 -0600 (Thu, 01 Jan 2009) | 2 lines #4782: Fix markup error that hid load() and loads(). ........ r68125 | georg.brandl | 2009-01-01 07:02:09 -0600 (Thu, 01 Jan 2009) | 2 lines #4776: add data_files and package_dir arguments. ........ r68126 | georg.brandl | 2009-01-01 07:05:13 -0600 (Thu, 01 Jan 2009) | 2 lines Handlers are in the `logging.handlers` module. ........ r68127 | georg.brandl | 2009-01-01 07:14:49 -0600 (Thu, 01 Jan 2009) | 2 lines #4767: Use correct submodules for all MIME classes. ........
Diffstat (limited to 'Lib/re.py')
-rw-r--r--Lib/re.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/re.py b/Lib/re.py
index 090ec8a..d2fc25d 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -160,7 +160,8 @@ def sub(pattern, repl, string, count=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;
- if a callable, it's passed the match object and must return
+ if a string, backslash escapes in it are processed. If it is
+ a callable, it's passed the match object and must return
a replacement string to be used."""
return _compile(pattern, 0).sub(repl, string, count)
@@ -170,7 +171,8 @@ def subn(pattern, repl, string, count=0):
non-overlapping occurrences of the pattern in the source
string by the replacement repl. number is the number of
substitutions that were made. repl can be either a string or a
- callable; if a callable, it's passed the match object and must
+ callable; if a string, backslash escapes in it are processed.
+ If it is a callable, it's passed the match object and must
return a replacement string to be used."""
return _compile(pattern, 0).subn(repl, string, count)