summaryrefslogtreecommitdiffstats
path: root/Doc/library/email.policy.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-08-09 20:17:00 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-08-09 20:17:00 (GMT)
commitfb1a7bc907021a57d9556c52f762f101eb55b5c1 (patch)
tree761c28821f9560c2116841416fcca8492945918e /Doc/library/email.policy.rst
parent2532635fcd30f250fe4dce6a3e0cfd0331c92520 (diff)
downloadcpython-fb1a7bc907021a57d9556c52f762f101eb55b5c1.zip
cpython-fb1a7bc907021a57d9556c52f762f101eb55b5c1.tar.gz
cpython-fb1a7bc907021a57d9556c52f762f101eb55b5c1.tar.bz2
#18600: In 3.3, as_string does not accept a policy keyword.
Also, document the policy keyword that was added to Message in 3.3.
Diffstat (limited to 'Doc/library/email.policy.rst')
-rw-r--r--Doc/library/email.policy.rst10
1 files changed, 0 insertions, 10 deletions
diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst
index 54ebb1c..99806ee 100644
--- a/Doc/library/email.policy.rst
+++ b/Doc/library/email.policy.rst
@@ -97,16 +97,6 @@ correct line separator characters when creating the binary string to feed into
``sendmail's`` ``stdin``, where the default policy would use ``\n`` line
separators.
-Some email package methods accept a *policy* keyword argument, allowing the
-policy to be overridden for that method. For example, the following code uses
-the :meth:`~email.message.Message.as_string` method of the *msg* object from
-the previous example and writes the message to a file using the native line
-separators for the platform on which it is running::
-
- >>> import os
- >>> with open('converted.txt', 'wb') as f:
- ... f.write(msg.as_string(policy=msg.policy.clone(linesep=os.linesep)))
-
Policy objects can also be combined using the addition operator, producing a
policy object whose settings are a combination of the non-default values of the
summed objects::