[issue9285] Add a profile decorator to profile and cProfile

Guido van Rossum report at bugs.python.org
Mon Feb 11 18:54:11 CET 2013


Guido van Rossum added the comment:

Brief comments:

- Please don't call it profile -- we already have a module by that name.

- Please make it so that both the decorator and context manager can specify a file where to dump the raw data -- basically it needs to have the same functionality as the functions run()/runctx()/runcall() (the latter TBD, see issue 17130).

- Please also make Profile object itself the context manager -- all you have to do is add __enter__() and __exit__() that call enable() and disable().  (But this doesn't completely replace the global function, which has more functionality -- it prints the profile or dumps the data).

----------
nosy: +gvanrossum

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9285>
_______________________________________


More information about the Python-bugs-list mailing list