Skip to content

Support copy.replace() for email.policy.Policy #155042

Description

@serhiy-storchaka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-emailtype-featureA feature request or enhancement

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions