You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2025. It is now read-only.
It doesn't cost anything and would enable a wider range of use cases. For example:
To determine whether the response body may be gzip-encoded in an after callback, the event object needs to be inspected (to get the request header "Accept-Encoding")
To pass state from the before to the after callback, the context variable could be used; e.g. to measure the time it took to process the request.
There's an initial proof-of-concept in jonaswitt@1ed4697 that works well for me.
For backwards compatibility, at least with the included decorators, it tries to figure out how many arguments the decorated function takes. I believe this could be extended to LambdaDecorator subclasses in order to avoid breaking existing user's code.
It uses getargspec() which works in Python 2 and 3 but is deprecated in Python 3. I haven't found a similar function that would work in both Python 2 and 3.
What do you think about this approach? I'd be happy to turn this into a PR (w/ updated documentation) if you agree with the general direction.