[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-29 Thread STINNER Victor
STINNER Victor added the comment: Jesse Bakker implemented all requested changes, I merged his PR. Well done, Jesse! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset 706e10b186992e086e661a62d2c8ec9588525b31 by Victor Stinner (Jesse-Bakker) in branch 'master': bpo-32121: Add most_recent_first parameter to tracemalloc.Traceback.format (#4534)

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-24 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: > While we are here, what if make a negative limit truncating from the opposite > side, as in the traceback module? Why not. I'm not opposed to that :-) -- ___ Python tracker

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: While we are here, what if make a negative limit truncating from the opposite side, as in the traceback module? -- nosy: +serhiy.storchaka ___ Python tracker

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: > what do you think of adding a new parameter but also **reverse frames by > default**? This would be fine with me. I didn't want to suggest it because it would break compatibility but obviously I find the current behaviour annoying :-)

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-24 Thread STINNER Victor
STINNER Victor added the comment: tracemalloc.Traceback contains "raw" data from the C _tracemalloc module. But since we are at Python level, we are free to change how data is rendered to user. Since Antoine Pitrou was surprised by the current frame order in

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-23 Thread Jesse Bakker
Jesse Bakker added the comment: I can work on this if you want. Can have a PR ready in a few minutes. -- nosy: +Jesse Bakker ___ Python tracker

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-23 Thread Jesse Bakker
Change by Jesse Bakker : -- keywords: +patch pull_requests: +4470 stage: needs patch -> patch review ___ Python tracker ___

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: The option seems reasonable. Would you like to work on a pull request? -- ___ Python tracker

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-23 Thread Antoine Pitrou
New submission from Antoine Pitrou : Right now tracemalloc.Traceback.format() returns the frames in "most recent call first" order. This is not intuitive since ordinary Python tracebacks are displayed in "most recent call last" order. It would be nice to add a `reverse`