I know that my question looks to broad, but I hope the answer on this question will give me correct direction what to read on. I am new to Tornado framework, basically I am new to Python. I am looking into this project: Could you please explain me a few lines of code:
@gen.coroutine
def get_me(self):
raise gen.Return((yield self._api.get_me()))
@gen.coroutine
annotation is for?raise
keyword is used for exceptions, isn't it? Why we use it here?generator
. Is the concept of Tornado framework to use generators. What is the reason? @gen
is a decorator, it will modify the function below it at definition.raise
to return values and will catch it with except gen.Return
(I find it ugly but it works).