bpo-39142: Avoid converting namedtuple instances to ConvertingTuple.#17773
bpo-39142: Avoid converting namedtuple instances to ConvertingTuple.#17773vsajip merged 2 commits intopython:masterfrom vsajip:fix-39142
Conversation
This uses the heuristic of assuming a named tuple is a subclass of tuple with a _fields attribute. This change means that contents of a named tuple wouldn't be converted - if a user wants to have ConvertingTuple functionality from a namedtuple, they will have to implement it themselves.
|
@tirkarthi - I would appreciate any comments you might have on this PR. Thanks for the analysis on the issue. |
corona10
left a comment
There was a problem hiding this comment.
Just comment:
We don't have to care structseq type in this issue?
I would say not, because it's easy and common to create a |
|
Thanks @vsajip for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
GH-17785 is a backport of this pull request to the 3.8 branch. |
|
Thanks @vsajip for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
|
GH-17786 is a backport of this pull request to the 3.7 branch. |
…ythonGH-17773) This uses the heuristic of assuming a named tuple is a subclass of tuple with a _fields attribute. This change means that contents of a named tuple wouldn't be converted - if a user wants to have ConvertingTuple functionality from a namedtuple, they will have to implement it themselves. (cherry picked from commit 46abfc1) Co-authored-by: Vinay Sajip <[email protected]>
|
…ythonGH-17773) This uses the heuristic of assuming a named tuple is a subclass of tuple with a _fields attribute. This change means that contents of a named tuple wouldn't be converted - if a user wants to have ConvertingTuple functionality from a namedtuple, they will have to implement it themselves.
This uses the heuristic of assuming a named tuple is a subclass of
tuple with a _fields attribute. This change means that contents of
a named tuple wouldn't be converted - if a user wants to have
ConvertingTuple functionality from a namedtuple, they will have to
implement it themselves.
https://bugs.python.org/issue39142