Support copy.replace() for email.policy.Policy
Open
Nobody has claimed this yet.
stdlib
topic-email
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
email.policy.Policy.clone() already has the semantics of copy.replace(), but the class does not support the protocol.
I propose to add __replace__ = clone, so that copy.replace(policy, max_line_length=100) works like policy.clone(max_line_length=100).
Linked PRs
- gh-155048
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with email.policy.Policy.clone and the copy.replace protocol described in the issue. Confirm that copy.replace(policy, max_line_length=100) behaves like policy.clone(max_line_length=100), and add or update coverage for that call before verifying the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100