Merge heads
This commit is contained in:
commit
5fa41f1d1e
|
@ -22,6 +22,25 @@ manages the codec and error handling lookup process.
|
|||
|
||||
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 the desired error handling scheme. The
|
||||
default error handler is ``strict`` meaning that encoding errors raise
|
||||
:exc:`ValueError` (or a more codec specific subclass, such as
|
||||
:exc:`UnicodeEncodeError`). Refer to :ref:`codec-base-classes` for more
|
||||
information on codec error handling.
|
||||
|
||||
.. function:: decode(obj, encoding='utf-8', errors='strict')
|
||||
|
||||
Decodes *obj* using the codec registered for *encoding*.
|
||||
|
||||
*Errors* may be given to set the desired error handling scheme. The
|
||||
default error handler is ``strict`` meaning that decoding errors raise
|
||||
:exc:`ValueError` (or a more codec specific subclass, such as
|
||||
:exc:`UnicodeDecodeError`). Refer to :ref:`codec-base-classes` for more
|
||||
information on codec error handling.
|
||||
|
||||
.. function:: register(search_function)
|
||||
|
||||
|
|
|
@ -197,6 +197,19 @@ The :meth:`~aifc.getparams` method now returns a namedtuple rather than a
|
|||
plain tuple. (Contributed by Claudiu Popa in :issue:`17818`.)
|
||||
|
||||
|
||||
codecs
|
||||
------
|
||||
|
||||
The :meth:`codecs.encode` and :meth:`codecs.decode` convenience functions are
|
||||
now properly documented. These functions have existed in the :mod:`codecs`
|
||||
module since ~2004, but were previously only discoverable through runtime
|
||||
introspection.
|
||||
|
||||
Unlike the convenience methods on :class:`str`, :class:`bytes` and
|
||||
:class:`bytearray`, these convenience functions support arbitrary codecs,
|
||||
rather than being limited to Unicode text encodings.
|
||||
|
||||
|
||||
colorsys
|
||||
--------
|
||||
|
||||
|
|
Loading…
Reference in New Issue