[Python-ideas] Allow Profile() to be used as a context manager
ubershmekel at gmail.com
Wed Jan 25 09:19:33 CET 2012
On Wed, Jan 25, 2012 at 8:36 AM, David Townshend <aquavitae69 at gmail.com>wrote:
> Any major objections to this?
At first this sounded like a good idea but 2 things pop to mind:
1. How does one get the pstat profiling output from the context manager?
Will printing out the results be the only option?
2. Usually when I profile I don't want to touch the code at all so
eventually if I'll use this context manager it'll be more akin to
Which isn't much of a win over
Now if you're talking about a reentrant profiler, that's interesting:
profiler = profile.Profiler()
and then I can call whatever method is there to get the pstat. If this is
the vision then it sounds awesome.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas