diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-01-02 09:57:15 -0600 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-01-02 09:57:15 -0600 |
commit | c5426baee36fe4521a29b5d455efeb61573ad50c (patch) | |
tree | 8196baeb344aa81508a6d0f31d68fc514c97e2c0 | |
parent | aa6ff181bf15eb6169097589c69238bbf3f549a0 (diff) | |
download | six-c5426baee36fe4521a29b5d455efeb61573ad50c.tar.gz |
document python_2_unicode_compatible
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | documentation/index.rst | 8 |
2 files changed, 11 insertions, 0 deletions
@@ -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 >>>>>>>>>>>>>>>>>>> |