summaryrefslogtreecommitdiff
path: root/documentation/index.rst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-01-02 09:57:15 -0600
committerBenjamin Peterson <benjamin@python.org>2015-01-02 09:57:15 -0600
commitc5426baee36fe4521a29b5d455efeb61573ad50c (patch)
tree8196baeb344aa81508a6d0f31d68fc514c97e2c0 /documentation/index.rst
parentaa6ff181bf15eb6169097589c69238bbf3f549a0 (diff)
downloadsix-c5426baee36fe4521a29b5d455efeb61573ad50c.tar.gz
document python_2_unicode_compatible
Diffstat (limited to 'documentation/index.rst')
-rw-r--r--documentation/index.rst8
1 files changed, 8 insertions, 0 deletions
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
>>>>>>>>>>>>>>>>>>>