I wonder if there is a way to enumerate decorators of the function while I have its reference during runtime.
Let’s say I have a list of functions in the runtime and I wish to know if they were decorated.
@app.route('/foo/bar', methods=['POST'], schema=Payload)
def some_endpoint(self, request, payload):
return f'Some response'
Or for an example, I wish to know if an instance of function I have in runtime has a concrete decorator like @deprecated
.
Example:
@deprecated
def foo():
# Implementation
It would be really interesting to find an access for a decorator especially if it is a decorator class.
Python version 3.6.2