-
Notifications
You must be signed in to change notification settings - Fork 258
Need an ability to set the methods I need to profile from the commandline arguments #85
Comments
Also, it will be extremely good if you add the ability to profile all functions and methods of a class (of even of a module). |
Both things are already possible. Of course, this issue is still not solved, because at very least, the solution is neither documented nor elegant. But it is better than adding and removing
Then you can just add |
Yes, but not everyone wants to profile all methods/functions. Just the ability to nominate a single function on the command line would be jolly useful. |
Hi @Alexey-Akishin ,
Which case would raise NameError? What this works for? Thanks. |
I think the following code is enough: try:
profile
except NameError:
no_profile = True The code could be simplified : try:
profile
except NameError:
def profile(function):
"""Dummy decorator - just return the function as is."""
return function |
Sometimes I don't want to modify the code I want to profile, so this will be extremely useful.
The text was updated successfully, but these errors were encountered: