We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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?
to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
assignee = None
closed_at = <Date 2018-09-11.17:54:10.821>
created_at = <Date 2016-03-07.11:15:48.241>
labels = ['3.8', 'type-bug', 'library']
title = 'traceback.extract_tb breaks compatibility by returning FrameSummary'
updated_at = <Date 2018-09-11.17:54:10.819>
user = 'https://github.com/encukou'
activity = <Date 2018-09-11.17:54:10.819>
actor = 'berker.peksag'
assignee = 'docs@python'
closed = True
closed_date = <Date 2018-09-11.17:54:10.821>
closer = 'berker.peksag'
components = ['Library (Lib)']
creation = <Date 2016-03-07.11:15:48.241>
creator = 'petr.viktorin'
dependencies = 
files = 
hgrepos = 
issue_num = 26502
keywords = ['patch']
message_count = 7.0
messages = ['261296', '261357', '275356', '324937', '325036', '325038', '325040']
nosy_count = 5.0
nosy_names = ['rbcollins', 'r.david.murray', 'petr.viktorin', 'docs@python', 'berker.peksag']
pr_nums = ['8632']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue26502'
versions = ['Python 3.8']
The text was updated successfully, but these errors were encountered:
According to the docs , traceback.extract_tb should return 4-tuples (filename, line number, function name, text).
Instead, since Python 3.5, it returns FrameSummary objects, which are not tuples, nor tuple subclasses, nor even sequences. (This broke some code in the wild that called len() on FrameSummary.)
bpo-25111 pointed out another tuple incompatibility, which was fixed. Should __len__ be added as well? Or the whole Sequence ABC?
I can provide a patch when those questions are answered.
Sorry, something went wrong.
This is basically a duplicate of bpo-25573. We need to add the examples in traceback module documentation to test_traceback.py.
Should __len__ be added as well?
Should __len__ be added as well?
IMO, the new FrameSummary API (and its friends) shouldn't change the return value of the existing traceback functions like extract_tb() so I'd say yes.
I disagree that this is a duplicate. The question here is, should we add __len__? Since a FrameSummary object can be "cast into a tuple" and has a known len, I would say the answer is definitely yes.
New changeset 9797b7a by Petr Viktorin (Berker Peksag) in branch 'master':
bpo-26502: Implement FrameSummary.__len__() (GH-8632)
Thanks for merging this, Petr. What do you think about backporting to 3.7?
I don't think I have a good enough feel for what should, generally, go to 3.7. So take my opinion with a grain of salt.
But honestly, I don't think the issue is important enough -- I've only seen one codebase affected by it, which wasn't hard to fix.
Ok, let's close this issue then.
No branches or pull requests