This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients docs@python, doerwalter, lemburg, ncoghlan, serhiy.storchaka
Date 2013-05-21.13:12:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1369141931.45.0.202348318231.issue17844@psf.upfronthosting.co.za>
In-reply-to
Content
While the Python 2 text model was almost certainly a necessary transition step to full unicode support, it is things like this that highlight how fundamentally broken implicit conversion turned out to be at a conceptual level :P

Perhaps the following would work for 2.7 then (with rot-13 in the first table), with footnotes added to cover the quirks of the implicit type conversions between str and unicode:

----
A number of predefined codecs are specific to Python, so their codec names have no meaning outside Python. These are listed in the tables below based on the expected input and output types (note that while text encodings are the most common use case for codecs, the underlying codec infrastructure supports arbitrary data transforms rather than just text encodings).  For asymmetric codecs, the stated purpose describes the encoding direction.

The following codecs provide unicode-to-str encoding [#1] and str-to-unicode decoding [#2], similar to the Unicode text encodings.
----
The following codecs provide str-to-str encoding and decoding [#2].
----

.. [#1] str objects are also accepted as input in place of unicode objects. They are implicitly converted to unicode by decoding them using the default encoding. If this conversion fails, it may lead to encoding operations raising :exc:`UnicodeDecodeError`.

.. [#2] unicode objects are also accepted as input in place of str objects. They are implicitly converted to str by encoding them using the default encoding. If this conversion fails, it may lead to decoding operations raising :exc:`UnicodeEncodeError`.
History
Date User Action Args
2013-05-21 13:12:11ncoghlansetrecipients: + ncoghlan, lemburg, doerwalter, docs@python, serhiy.storchaka
2013-05-21 13:12:11ncoghlansetmessageid: <1369141931.45.0.202348318231.issue17844@psf.upfronthosting.co.za>
2013-05-21 13:12:11ncoghlanlinkissue17844 messages
2013-05-21 13:12:11ncoghlancreate