Skip to content

Support copy.replace() for argparse.Namespace #155043

Closed

Description

@serhiy-storchaka

Feature or enhancement

types.SimpleNamespace supports copy.replace() (gh-109174), but argparse.Namespace, its analogue in argparse, does not.

I propose to support it with the same semantics: copy.replace(args, verbose=True) returns a new namespace with the specified attributes replaced or added.

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Aug 1, 2026
  2. added a commit that references this issue on Aug 5, 2026
  3. added a commit that references this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions