From 21d1d8ec6a7ae7c97888e94dd926cdb7ee40a5d8 Mon Sep 17 00:00:00 2001 From: SUPREME Date: Sun, 31 May 2026 12:54:18 +0530 Subject: [PATCH] docs: add module-level docstring to websockets module Documents the WebSocket re-exports from Starlette, clarifying that this module provides a consistent FastAPI import path for WebSocket classes. --- fastapi/websockets.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fastapi/websockets.py b/fastapi/websockets.py index 55a4ac4a1a..07f6ff8af5 100644 --- a/fastapi/websockets.py +++ b/fastapi/websockets.py @@ -1,3 +1,11 @@ +""" +WebSocket support for FastAPI. + +Re-exports Starlette's WebSocket classes for use in FastAPI applications, +providing a consistent import path for WebSocket, WebSocketDisconnect, and +WebSocketState. +""" + from starlette.websockets import WebSocket as WebSocket # noqa from starlette.websockets import WebSocketDisconnect as WebSocketDisconnect # noqa from starlette.websockets import WebSocketState as WebSocketState # noqa