[issue9941] Unify trace and profile interfaces
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: -- versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9941 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9941] Unify trace and profile interfaces
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I've ran into a problem adding context manager functionality to Profile/Trace objects. When profile/trace function is set in __enter__ and removed in __exit__ it catches two spurious events: a return from __enter__ and a call to __exit__. This is particularly problematic with Profile which is not prepared to handle a return event that does not follow a matching call. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9941 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9941] Unify trace and profile interfaces
Georg Brandl ge...@python.org added the comment: Sounds good to me. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9941 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9941] Unify trace and profile interfaces
New submission from Alexander Belopolsky belopol...@users.sourceforge.net: The trace and profile modules provide similar functionality, but have some gratuitous differences in their APIs and command line interfaces. For example, the method to trace a single call is Trace.runfunc, but almost identical Profile method is called runcall. The CLIs provided by the two modules are vastly different: profile splits out formatting of the results into a separate module, pstats, while trace module includes many options to control the output of traced runs. This situation leeds to an unnecessary burden on users who need to learn two different ways to do very similar things. -- assignee: belopolsky components: Library (Lib) messages: 117309 nosy: belopolsky priority: normal severity: normal stage: needs patch status: open title: Unify trace and profile interfaces type: feature request versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9941 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9941] Unify trace and profile interfaces
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: The runfunc/runcall difference is the easiest to address. I propose to add runcall to Trace as an alias to runfunc and deprecate runfunc. In addition, I propose to add __enter__ and __exit__ methods to both Trace and Profile so that they can be used as context managers. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9941 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com