I want to get the line number of a python function in the source code. What i have in runtime is module, class, method objects
Had a look at inspect
inspect.getsourcelines(object)
which also gives line number in result.
I see that for methods with decorators, line no. returned from above inspect function points to the actual decorator's source code rather than desired function's source code. So any way to workaround this? (i understand that interpreter does something like wrapping function inside decorator in runtime, but i might be wrong)