summaryrefslogtreecommitdiffstats
path: root/Doc/library/email.policy.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-08-09 20:15:28 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-08-09 20:15:28 (GMT)
commitbb17d2b857d33e474f830c4a665f1fa412eb29f1 (patch)
tree6abcd65ca409e435a0a0b4b7184c3a2318402e3e /Doc/library/email.policy.rst
parent3f58277382f3e337d225da547bdb26bc555570a4 (diff)
downloadcpython-bb17d2b857d33e474f830c4a665f1fa412eb29f1.zip
cpython-bb17d2b857d33e474f830c4a665f1fa412eb29f1.tar.gz
cpython-bb17d2b857d33e474f830c4a665f1fa412eb29f1.tar.bz2
#18600: add policy to add_string, and as_bytes and __bytes__ methods.
This was triggered by wanting to make the doctest in email.policy.rst pass; as_bytes and __bytes__ are clearly useful now that we have BytesGenerator. Also updated the Message docs to document the policy keyword that was added in 3.3.
Diffstat (limited to 'Doc/library/email.policy.rst')
-rw-r--r--Doc/library/email.policy.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst
index 54ebb1c..93c5350 100644
--- a/Doc/library/email.policy.rst
+++ b/Doc/library/email.policy.rst
@@ -105,7 +105,8 @@ 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)))
+ ... f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))
+ 17
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