Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Feature or enhancement
Proposal:
This issue is to make the concept of"named tuple" support the__replace__ protocol.
collections.namedtuple andtyping.NamedTuple already support the__replace__ protocol in:
PyStructSequences are alsonamed tuples but they do not support the__replace__ protocol yet.
It would be convenient ifPyStructSequence be supported incopy.replace().
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
- Add generalized replace() function #108751
- https://discuss.python.org/t/generalize-replace-function/28511
- Also test
typing.NamedTuplewithcopy.replace#109956 - Add support of SimpleNamespace in copy.replace() #109174
- gh-109174: Add support of SimpleNamespace in copy.replace() #109175