New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support of PyStructSequence in copy.replace() #110222
Comments
|
I created a PR to resolve this. |
|
PyStructSequence with unnamed fields is a special case. Currently the only such structure is The simplest solution is to disable There may be a special implementation of |
I can confirm this is a bug for PyStructSequence with unnamed fields if we rely on
I agree to raise an error for this (e.g.,
I think it's better to disable |
Feature or enhancement
Proposal:
This issue is to make the concept of "named tuple" support the
__replace__protocol.collections.namedtupleandtyping.NamedTuplealready support the__replace__protocol in:PyStructSequences are also named tuples but they do not support the__replace__protocol yet.It would be convenient if
PyStructSequencebe 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:
typing.NamedTuplewithcopy.replace#109956Linked PRs
The text was updated successfully, but these errors were encountered: