diff -r acaf73e3d882 Doc/library/codecs.rst --- a/Doc/library/codecs.rst Sat Jun 29 18:42:24 2013 -0400 +++ b/Doc/library/codecs.rst Mon Jul 08 14:59:33 2013 +1000 @@ -22,6 +22,21 @@ It defines the following functions: +.. function:: encode(obj, encoding='utf-8', errors='strict') + + Encodes obj using the codec registered for encoding. Errors may be given + to set a different error handling scheme. Default is ``strict`` meaning that + encoding errors raise a :exc:`ValueError`. Other possible values are ``ignore``, + ``replace`` and ``xmlcharrefreplace`` as well as any other name registered with + ``codecs.register_error`` that can handle :exc:`ValueError`. + +.. function:: decode(obj, encoding='utf-8', errors='strict') + + Decodes obj using the codec registered for encoding. Errors may be given + to set a different error handling scheme. Default is ``strict`` meaning that + encoding errors raise a :exc:`ValueError`. Other possible values are ``ignore`` + and ``replace`` as well as any other name registered with ``codecs.register_error`` + that is able to handle :exc:`ValueError`. .. function:: register(search_function) diff -r acaf73e3d882 Doc/whatsnew/3.4.rst --- a/Doc/whatsnew/3.4.rst Sat Jun 29 18:42:24 2013 -0400 +++ b/Doc/whatsnew/3.4.rst Mon Jul 08 14:59:33 2013 +1000 @@ -223,12 +223,22 @@ plain tuple. (Contributed by Claudiu Popa in :issue:`17487`.) stat ---- +---- The stat module is now backed by a C implementation in :mod:`_stat`. A C implementation is required as most of the values aren't standardized and platform-dependent. (Contributed by Christian Heimes in :issue:`11016`.) +codec +----- + +The :meth:`~codec.encode` and :meth:`~codec.decode` convenience methods have +now been added to the documentation. The difference between these methods and +similiar methods for str, bytes and bytearray, is that the latter have +additional type checks to limit their usage to text encodings. These methods +have existed in the codecs module since ~2004, but were only documented through +docstrings. + Optimizations =============