summaryrefslogtreecommitdiffstats
path: root/Doc/library/email.header.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-02-01 11:56:49 (GMT)
committerGeorg Brandl <georg@python.org>2008-02-01 11:56:49 (GMT)
commitf69451833191454bfef75804c2654dc37e8f3e93 (patch)
tree7e81560f5276c35f68b7b02e75feb9221a82ae5d /Doc/library/email.header.rst
parentf25ef50549d9f2bcb6294fe61a9902490728edcc (diff)
downloadcpython-f69451833191454bfef75804c2654dc37e8f3e93.zip
cpython-f69451833191454bfef75804c2654dc37e8f3e93.tar.gz
cpython-f69451833191454bfef75804c2654dc37e8f3e93.tar.bz2
Update docs w.r.t. PEP 3100 changes -- patch for GHOP by Dan Finnie.
Diffstat (limited to 'Doc/library/email.header.rst')
-rw-r--r--Doc/library/email.header.rst20
1 files changed, 10 insertions, 10 deletions
diff --git a/Doc/library/email.header.rst b/Doc/library/email.header.rst
index c426c95..ecd9f1f 100644
--- a/Doc/library/email.header.rst
+++ b/Doc/library/email.header.rst
@@ -53,8 +53,8 @@ Here is the :class:`Header` class description:
Optional *s* is the initial header value. If ``None`` (the default), the
initial header value is not set. You can later append to the header with
- :meth:`append` method calls. *s* may be a byte string or a Unicode string, but
- see the :meth:`append` documentation for semantics.
+ :meth:`append` method calls. *s* may be an instance of :class:`bytes` or
+ :class:`str`, but see the :meth:`append` documentation for semantics.
Optional *charset* serves two purposes: it has the same meaning as the *charset*
argument to the :meth:`append` method. It also sets the default character set
@@ -86,19 +86,19 @@ Optional *errors* is passed straight through to the :meth:`append` method.
a :class:`Charset` instance. A value of ``None`` (the default) means that the
*charset* given in the constructor is used.
- *s* may be a byte string or a Unicode string. If it is a byte string (i.e.
- ``isinstance(s, str)`` is true), then *charset* is the encoding of that byte
- string, and a :exc:`UnicodeError` will be raised if the string cannot be decoded
- with that character set.
+ *s* may be an instance of :class:`bytes` or :class:`str`. If it is an instance
+ of :class:`bytes`, then *charset* is the encoding of that byte string, and a
+ :exc:`UnicodeError` will be raised if the string cannot be decoded with that
+ character set.
- If *s* is a Unicode string, then *charset* is a hint specifying the character
- set of the characters in the string. In this case, when producing an
+ If *s* is an instance of :class:`str`, then *charset* is a hint specifying the
+ character set of the characters in the string. In this case, when producing an
:rfc:`2822`\ -compliant header using :rfc:`2047` rules, the Unicode string will
be encoded using the following charsets in order: ``us-ascii``, the *charset*
hint, ``utf-8``. The first character set to not provoke a :exc:`UnicodeError`
is used.
- Optional *errors* is passed through to any :func:`unicode` or
+ Optional *errors* is passed through to any :func:`encode` or
:func:`ustr.encode` call, and defaults to "strict".
@@ -121,7 +121,7 @@ operators and built-in functions.
.. method:: Header.__unicode__()
- A helper for the built-in :func:`unicode` function. Returns the header as a
+ A helper for :class:`str`'s :func:`encode` method. Returns the header as a
Unicode string.