[Python-checkins] cpython: whatsnew: return types of re functions.

r.david.murray python-checkins at python.org
Sat Mar 1 18:11:54 CET 2014


http://hg.python.org/cpython/rev/962f340f2487
changeset:   89437:962f340f2487
user:        R David Murray <rdmurray at bitdance.com>
date:        Thu Feb 27 18:32:32 2014 -0500
summary:
  whatsnew: return types of re functions.

files:
  Doc/whatsnew/3.4.rst |  7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)


diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -1987,6 +1987,13 @@
   in theory this should not cause backward compatibility issues since the
   disallowed command forms didn't make any sense and are unlikely to be in use.
 
+* The :func:`re.split`, :func:`re.findall`, and :func:`re.sub` functions, and
+  the :meth:`~re.match.group` and :meth:`~re.match.groups` methods of
+  :class:``match`` objects now always return a *bytes* object when the string
+  to be matched is a :term:`bytes-like object`.  Previously the return type
+  matched the input type, so if your code was depending on the return value
+  being, say, a ``bytearray``, you will need to change your code.
+
 
 Changes in the C API
 --------------------

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


More information about the Python-checkins mailing list