#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.
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 @@
>>> 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