classification
Title: Consolidate traceback.format_tb and traceback.print_tb
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: out of date
Dependencies: Superseder: traceback.py has a lot of code duplication
View: 17646
Assigned To: Nosy List: benjamin.peterson, raduv
Priority: normal Keywords: patch

Created on 2013-03-20 02:48 by raduv, last changed 2013-04-17 03:46 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
consolidate_tb_functions.diff raduv, 2013-03-20 02:48 review
Messages (3)
msg184725 - (view) Author: Radu Voicilas (raduv) Date: 2013-03-20 02:48
This is a patch that consolidates the implementation of traceback.format_tb and traceback.print_tb into one common internal function traceback._get_tb. The current implementations are almost identical, except that the print_tb() ones also prints to a file ...

Now, I don't really know what the Python developers feel about this kind of cleanups which doesn't really add any value for the end user. I've seen projects where this kind of patches are not accepted because of this. IMHO, making code more readable and reducing duplication is always a good thing.
msg185388 - (view) Author: Radu Voicilas (raduv) Date: 2013-03-27 23:08
Is there anything else that I have to do in order for this patch to be looked at ? I am holding off a similar one for print_exception vs. format_exception
msg185391 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-03-28 00:17
Thank you for the patch. It seems like it would make more sense to implement print_tb in terms of extract_tb. That is, print_tb should iterate through the result of extract_tb and do its printing.
History
Date User Action Args
2013-04-17 03:46:12benjamin.petersonsetstatus: open -> closed
superseder: traceback.py has a lot of code duplication
resolution: out of date
2013-03-28 00:17:55benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg185391
2013-03-27 23:08:33raduvsetmessages: + msg185388
2013-03-20 02:48:57raduvcreate