From cbfd795985e502ec74e75185dd845105e46375a5 Mon Sep 17 00:00:00 2001 From: qadzek <84473512+qadzek@users.noreply.github.com> Date: Fri, 17 Jul 2026 12:15:33 +0200 Subject: [PATCH] fix(python): add `raise_for_status` to type stub --- impit-python/python/impit/impit.pyi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/impit-python/python/impit/impit.pyi b/impit-python/python/impit/impit.pyi index 88d9a395..62c9b2b7 100644 --- a/impit-python/python/impit/impit.pyi +++ b/impit-python/python/impit/impit.pyi @@ -349,6 +349,17 @@ class Response: print(data) # Parsed JSON data as a Python object (dict, list, etc.) """ + def raise_for_status(self) -> None: + """Raise an :class:`HTTPStatusError` exception if the response status code indicates an error (4xx or 5xx). + + Does nothing for successful status codes. + + .. code-block:: python + + response = await client.get("https://api.example.com/data") + response.raise_for_status() # Raises if status is 4xx or 5xx + """ + def close(self) -> None: """Close the response and release resources.