[Python-checkins] cpython (merge 3.3 -> default): #16304: merge with 3.3.

ezio.melotti python-checkins at python.org
Sun Nov 4 06:00:23 CET 2012


http://hg.python.org/cpython/rev/63b45c959a2a
changeset:   80235:63b45c959a2a
parent:      80230:58776cc74e89
parent:      80234:7fde4b4f7e56
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sun Nov 04 07:00:04 2012 +0200
summary:
  #16304: merge with 3.3.

files:
  Doc/library/re.rst |  13 ++++++++++---
  1 files changed, 10 insertions(+), 3 deletions(-)


diff --git a/Doc/library/re.rst b/Doc/library/re.rst
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -824,9 +824,16 @@
 Match Objects
 -------------
 
-Match objects always have a boolean value of :const:`True`.  This lets you
-use a simple if-statement to test whether a match was found.  Match objects
-support the following methods and attributes:
+Match objects always have a boolean value of ``True``.
+Since :meth:`~regex.match` and :meth:`~regex.search` return ``None``
+when there is no match, you can test whether there was a match with a simple
+``if`` statement::
+
+   match = re.search(pattern, string)
+   if match:
+       process(match)
+
+Match objects support the following methods and attributes:
 
 
 .. method:: match.expand(template)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list