I'm trying to use cProfile to profile some python code. I believe I need to use cProfile.runcall(), not cProfile.run(), since the method I want to run is of the form self.funct() rather than simply funct().
When I try to use cProfile.runcall, detailed here, I get the following error:
AttributeError: 'module' object has no attribute 'runcall'
Has the runcall method been removed from cProfile? If so, is there an alternate method to use of the form cProfile.runcall(self.funct,*args)?
Minimum (not) working example:
import cProfile def funct(a): print a cProfile.runcall(funct,"Hello")
cProfilemodule isn't interchangeable with theprofilemodule. In other words the first statement in the Python 2,7 documentation for them, that "Both theprofileandcProfilemodules provide the following functions: ...", is patently wrong—and the differences aren'y described anywhere (that I could locate).profile.