Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-39142: Avoid converting namedtuple instances to ConvertingTuple. #17773
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.
This comment has been minimized.
This comment has been minimized.
@tirkarthi - I would appreciate any comments you might have on this PR. Thanks for the analysis on the issue. |
Just comment: |
This comment has been minimized.
This comment has been minimized.
I would say not, because it's easy and common to create a |
46abfc1
into
python:master
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jan 1, 2020
Thanks @vsajip for the PR |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 1, 2020
GH-17785 is a backport of this pull request to the 3.8 branch. |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jan 1, 2020
Thanks @vsajip for the PR |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 1, 2020
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 <vinay_sajip@yahoo.co.uk>
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 2, 2020
|
vsajip commentedDec 31, 2019
•
edited by bedevere-bot
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