Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1146)

#11731: Simplify email API via 'policy' objects

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 years, 1 month ago by rdmurray
Modified:
2 years, 1 month ago
Reviewers:
merwok, barry
CC:
barry, r.david.murray, devnull_devnull, devnull_psf.upfronthosting.co.za
Visibility:
Public.

Patch Set 1 #

Total comments: 41

Patch Set 2 #

Patch Set 3 #

Total comments: 20

Patch Set 4 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
.hgtags View 1 chunk +1 line, -0 lines 0 comments Download
Doc/library/email.generator.rst View 1 6 chunks +37 lines, -18 lines 0 comments Download
Doc/library/email.parser.rst View 1 6 chunks +40 lines, -14 lines 0 comments Download
Doc/library/email.policy.rst View 1 2 3 1 chunk +179 lines, -0 lines 0 comments Download
Lib/email/errors.py View 1 chunk +1 line, -1 line 0 comments Download
Lib/email/feedparser.py View 6 chunks +17 lines, -6 lines 0 comments Download
Lib/email/generator.py View 1 7 chunks +37 lines, -25 lines 0 comments Download
Lib/email/parser.py View 3 chunks +9 lines, -2 lines 0 comments Download
Lib/email/policy.py View 1 2 3 1 chunk +174 lines, -0 lines 0 comments Download
Lib/test/test_email/__init__.py View 1 chunk +2 lines, -0 lines 0 comments Download
Lib/test/test_email/test_email.py View 1 2 3 6 chunks +130 lines, -16 lines 0 comments Download
Lib/test/test_email/test_generator.py View 2 3 1 chunk +136 lines, -0 lines 0 comments Download
Lib/test/test_email/test_policy.py View 1 2 3 1 chunk +148 lines, -0 lines 0 comments Download

Messages

Total messages: 15
eric.araujo
A small contribution for the excellent-looking new policy framework: typos and markup glitches. HTH http://bugs.python.org/review/11731/diff/2329/5464 ...
2 years, 1 month ago #1
r.david.murray
Thanks for the review. http://bugs.python.org/review/11731/diff/2329/5464 File Doc/library/email.generator.rst (right): http://bugs.python.org/review/11731/diff/2329/5464#newcode57 Doc/library/email.generator.rst:57: The *policy* keyword specifies a ...
2 years, 1 month ago #2
eric.araujo
http://bugs.python.org/review/11731/diff/2329/5464 File Doc/library/email.generator.rst (right): http://bugs.python.org/review/11731/diff/2329/5464#newcode57 Doc/library/email.generator.rst:57: The *policy* keyword specifies a :mod:`~email.policy` object that controls ...
2 years, 1 month ago #3
r.david.murray
http://bugs.python.org/review/11731/diff/2329/5464 File Doc/library/email.generator.rst (right): http://bugs.python.org/review/11731/diff/2329/5464#newcode61 Doc/library/email.generator.rst:61: .. versionchanged:: 3.3 Added the *policy* keyword. On 2011/04/08 ...
2 years, 1 month ago #4
barry
http://bugs.python.org/review/11731/diff/2418/5678 File Lib/email/feedparser.py (right): http://bugs.python.org/review/11731/diff/2418/5678#newcode183 Lib/email/feedparser.py:183: self.policy.handle_defect(root, defect) This looks like a common pattern. I ...
2 years, 1 month ago #5
eric.araujo
(The quote handling is a bit buggy in rietveld, so please go to the web ...
2 years, 1 month ago #6
eric.araujo
http://bugs.python.org/review/11731/diff/2329/5464 File Doc/library/email.generator.rst (right): http://bugs.python.org/review/11731/diff/2329/5464#newcode61 Doc/library/email.generator.rst:61: .. versionchanged:: 3.3 Added the *policy* keyword. Makes sense, ...
2 years, 1 month ago #7
r.david.murray
Thanks for the reviews. http://bugs.python.org/review/11731/diff/2418/5678 File Lib/email/feedparser.py (right): http://bugs.python.org/review/11731/diff/2418/5678#newcode183 Lib/email/feedparser.py:183: self.policy.handle_defect(root, defect) On 2011/04/15 14:46:31, ...
2 years, 1 month ago #8
r.david.murray
http://bugs.python.org/review/11731/diff/2329/5466 File Doc/library/email.policy.rst (right): http://bugs.python.org/review/11731/diff/2329/5466#newcode73 Doc/library/email.policy.rst:73: >>> strict_SMTP = email.policy.SMTP(raise_on_defect=True) On 2011/04/15 16:45:16, eric.araujo wrote: ...
2 years, 1 month ago #9
barry
http://bugs.python.org/review/11731/diff/2418/5678 File Lib/email/feedparser.py (right): http://bugs.python.org/review/11731/diff/2418/5678#newcode183 Lib/email/feedparser.py:183: self.policy.handle_defect(root, defect) On 2011/04/15 17:23:01, r.david.murray wrote: > On ...
2 years, 1 month ago #10
eric.araujo
> Call syntax just seems anti-discoverable, Thanks for wording so clearly this reason for not ...
2 years, 1 month ago #11
eric.araujo
http://bugs.python.org/review/11731/diff/2329/5466 File Doc/library/email.policy.rst (right): http://bugs.python.org/review/11731/diff/2329/5466#newcode73 Doc/library/email.policy.rst:73: >>> strict_SMTP = email.policy.SMTP(raise_on_defect=True) Barry says: > I dunno, ...
2 years, 1 month ago #12
r.david.murray
On 2011/04/15 18:30:35, eric.araujo wrote: > > Call syntax just seems anti-discoverable, > Thanks for ...
2 years, 1 month ago #13
r.david.murray
http://bugs.python.org/review/11731/diff/2329/5466 File Doc/library/email.policy.rst (right): http://bugs.python.org/review/11731/diff/2329/5466#newcode73 Doc/library/email.policy.rst:73: >>> strict_SMTP = email.policy.SMTP(raise_on_defect=True) On 2011/04/15 18:35:30, eric.araujo wrote: ...
2 years, 1 month ago #14
r.david.murray
2 years, 1 month ago #15
On 2011/04/15 19:14:23, r.david.murray wrote:
> I replied via email but I guess that doesn't show up here.  I've gone with
> 'clone', though 'derive' would be OK too.  make in namedtuple takes an
argument
> that completely defines the contents of the returned object, which makes sense
> for the word 'make'.  The policy function copies the existing content and then
> modifies it, so 'make' doesn't really work.

Barry replied to my email that didn't get reported here pointing out that
policy.default.clone() is an unmodified clone, which I think cinches the
decision in favor of the name 'clone'.

So, I think the patch is ready for commit.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7