Skip to content

Commit c77745d

Browse files
committed
Add comments for decorator
1 parent f2f5bb5 commit c77745d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

robyn/__init__.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ def before_request(self, endpoint):
9191
:param endpoint [str]: [endpoint to server the route]
9292
"""
9393

94+
# This inner function is basically a wrapper arround the closure(decorator)
95+
# being returned.
96+
# It takes in a handler and converts it in into a closure
97+
# and returns the arguments.
98+
# Arguments are returned as they could be modified by the middlewares.
9499
def inner(handler):
95-
# add handling for async functions
96100
async def async_inner_handler(*args):
97101
await handler(args)
98102
return args
@@ -115,8 +119,12 @@ def after_request(self, endpoint):
115119
:param endpoint [str]: [endpoint to server the route]
116120
"""
117121

122+
# This inner function is basically a wrapper arround the closure(decorator)
123+
# being returned.
124+
# It takes in a handler and converts it in into a closure
125+
# and returns the arguments.
126+
# Arguments are returned as they could be modified by the middlewares.
118127
def inner(handler):
119-
# add handling for async functions
120128
async def async_inner_handler(*args):
121129
await handler(args)
122130
return args

0 commit comments

Comments
 (0)