Content-Length: 263638 | pFad | https://github.com/python/cpython/issues/109174

8A Add support of SimpleNamespace in copy.replace() · Issue #109174 · python/cpython · GitHub
Skip to content

Add support of SimpleNamespace in copy.replace() #109174

@serhiy-storchaka

Description

@serhiy-storchaka

Feature or enhancement

SimpleNamespace is used as a simple data record type, a simpler alternative to named tuples and dataclasses. Although it is easy to create a copy of a SimpleNamespace instance with modified attributes (SimpleNamespace(**vars(ns), attr=newvalue)), it would be convenient if SimpleNamespace be supported in copy.replace() which already supports named tuples and dataclasses.

#108751
https://discuss.python.org/t/generalize-replace-function/28511

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/109174

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy