From 18017918ca12520514acd9aab33c8b3242d637de Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Fri, 2 May 2025 16:26:32 -0400 Subject: [PATCH] (doc) Mention requiring closing Reddit http connection --- docs/getting_started/quick_start.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/getting_started/quick_start.rst b/docs/getting_started/quick_start.rst index 1daa647a..004b92a3 100644 --- a/docs/getting_started/quick_start.rst +++ b/docs/getting_started/quick_start.rst @@ -157,6 +157,16 @@ to read-only mode whenever you want: If you are uncomfortable hard-coding your credentials into your program, there are some options available to you. Please see: :ref:`configuration`. +Close Connections in :class:`.Reddit` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The asynchronous context requires closing your session when you finish using Reddit: + +.. code-block:: python + + reddit = asyncpraw.Reddit(...) + await reddit.close() + Obtain a :class:`.Subreddit` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~