[Python-checkins] python/dist/src/Lib sre.py,1.48,1.49
akuchling at users.sourceforge.net
akuchling at users.sourceforge.net
Sat Aug 7 19:41:56 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27345
Modified Files:
sre.py
Log Message:
[Bug #990792] Mention that repl can be a callable
Index: sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** sre.py 20 Apr 2004 21:11:11 -0000 1.48
--- sre.py 7 Aug 2004 17:41:54 -0000 1.49
***************
*** 140,144 ****
"""Return the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in string by the
! replacement repl"""
return _compile(pattern, 0).sub(repl, string, count)
--- 140,146 ----
"""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
! a replacement string to be used."""
return _compile(pattern, 0).sub(repl, string, count)
***************
*** 148,152 ****
non-overlapping occurrences of the pattern in the source
string by the replacement repl. number is the number of
! substitutions that were made."""
return _compile(pattern, 0).subn(repl, string, count)
--- 150,156 ----
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
! return a replacement string to be used."""
return _compile(pattern, 0).subn(repl, string, count)
More information about the Python-checkins
mailing list