+ 1
How to debug decorator method
Hi We all know function goes inside function by using f11 on visual studio. How can we debug decorator code in python if we don't put directly a break point in decorator function?
2 ответов
0
You can use the `pdb.set_trace()` function inside the decorator code where you want to start debugging.
0
Do you mean pdb.set_trace() should be first line in my main function?
For example,
Myfunc(): is decorated by @mydecorator. Hence, set_trace should be first line in myfunc and it would suggest the path of mydecorator ?