From c5426baee36fe4521a29b5d455efeb61573ad50c Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Fri, 2 Jan 2015 09:57:15 -0600 Subject: document python_2_unicode_compatible --- CHANGES | 3 +++ documentation/index.rst | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index e12508a..e257d61 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,9 @@ This file lists the changes in each six version. Development version ------------------- +- Pull request #48 and issue #15: Add the `python_2_unicode_compatible` + decorator. + - Pull request #57 and issue #50: Add several compatibility methods for unittest assertions that were renamed between Python 2 and 3. diff --git a/documentation/index.rst b/documentation/index.rst index 0755043..e0ce4cc 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -437,6 +437,14 @@ string data in all Python versions. :class:`py3:io.BytesIO`. +.. decorator:: python_2_unicode_compatible + + A class decorator that takes a class defining a ``__str__`` method. On + Python 3, the decorator does nothing. On Python 2, it aliases the + ``__str__`` method to ``__unicode__`` and creates a new ``__str__`` method + that returns the result of ``__unicode__()`` encoded with UTF-8. + + unittest assertions >>>>>>>>>>>>>>>>>>> -- cgit v1.2.1