[Python-checkins] r72294 - in python/branches/py3k/Doc: howto/unicode.rst library/stdtypes.rst

georg.brandl python-checkins at python.org
Mon May 4 23:01:20 CEST 2009


Author: georg.brandl
Date: Mon May  4 23:01:20 2009
New Revision: 72294

Log:
Add missing documentation for bytes.decode().

Modified:
   python/branches/py3k/Doc/howto/unicode.rst
   python/branches/py3k/Doc/library/stdtypes.rst

Modified: python/branches/py3k/Doc/howto/unicode.rst
==============================================================================
--- python/branches/py3k/Doc/howto/unicode.rst	(original)
+++ python/branches/py3k/Doc/howto/unicode.rst	Mon May  4 23:01:20 2009
@@ -234,7 +234,7 @@
 
 Since Python 3.0, the language features a ``str`` type that contain Unicode
 characters, meaning any string created using ``"unicode rocks!"``, ``'unicode
-rocks!``, or the triple-quoted string syntax is stored as Unicode.
+rocks!'``, or the triple-quoted string syntax is stored as Unicode.
 
 To insert a Unicode character that is not part ASCII, e.g., any letters with
 accents, one can use escape sequences in their string literals as such::

Modified: python/branches/py3k/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k/Doc/library/stdtypes.rst	(original)
+++ python/branches/py3k/Doc/library/stdtypes.rst	Mon May  4 23:01:20 2009
@@ -800,14 +800,14 @@
 
 .. method:: str.encode([encoding[, errors]])
 
-   Return an encoded version of the string.  Default encoding is the current
-   default string encoding.  *errors* may be given to set a different error
-   handling scheme.  The default for *errors* is ``'strict'``, meaning that
-   encoding errors raise a :exc:`UnicodeError`.  Other possible values are
-   ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and
-   any other name registered via :func:`codecs.register_error`, see section
-   :ref:`codec-base-classes`. For a list of possible encodings, see section
-   :ref:`standard-encodings`.
+   Return an encoded version of the string as a bytes object.  Default encoding
+   is the current default string encoding.  *errors* may be given to set a
+   different error handling scheme.  The default for *errors* is ``'strict'``,
+   meaning that encoding errors raise a :exc:`UnicodeError`.  Other possible
+   values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``,
+   ``'backslashreplace'`` and any other name registered via
+   :func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a
+   list of possible encodings, see section :ref:`standard-encodings`.
 
 
 .. method:: str.endswith(suffix[, start[, end]])
@@ -1512,6 +1512,18 @@
       b = a.replace(b"a", b"f")
 
 
+.. method:: bytes.decode([encoding[, errors]])
+            bytearray.decode([encoding[, errors]])
+
+   Return a string decoded from the given bytes.  Default encoding is the
+   current default string encoding.  *errors* may be given to set a different
+   error handling scheme.  The default for *errors* is ``'strict'``, meaning
+   that encoding errors raise a :exc:`UnicodeError`.  Other possible values are
+   ``'ignore'``, ``'replace'`` and any other name registered via
+   :func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a
+   list of possible encodings, see section :ref:`standard-encodings`.
+
+
 The bytes and bytearray types have an additional class method:
 
 .. classmethod:: bytes.fromhex(string)


More information about the Python-checkins mailing list