Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docstring in RequestHandler.prepare() and on_finish() #3431

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tornado/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ def _unimplemented_method(self, *args: str, **kwargs: str) -> None:
def prepare(self) -> Optional[Awaitable[None]]:
"""Called at the beginning of a request before `get`/`post`/etc.

Override this method to perform common initialization regardless
of the request method.
Override this method to perform common initialization for request method.
If the request method is not in ``SUPPORTED_METHODS`` this will not be called.

Asynchronous support: Use ``async def`` or decorate this method with
`.gen.coroutine` to make it asynchronous.
Expand All @@ -300,8 +300,8 @@ def on_finish(self) -> None:
"""Called after the end of a request.

Override this method to perform cleanup, logging, etc.
This method is a counterpart to `prepare`. ``on_finish`` may
not produce any output, as it is called after the response
This method is a counterpart to `prepare` - except it will be called even if the request method is not in ``SUPPORTED_METHODS``.
``on_finish`` may not produce any output, as it is called after the response
has been sent to the client.
"""
pass
Expand Down