From aee9106364cdca7c7da5b22fb06b9b7fc42d7cb2 Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Fri, 24 Jul 2020 11:13:14 +0100 Subject: [PATCH] Add type annotation to WebSocketEndpoint.encoding (#1003) * Add type annotation to WebSocketEndpoint.encoding * Update endpoints.py Co-authored-by: Florimond Manca --- starlette/endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/starlette/endpoints.py b/starlette/endpoints.py index 2ba68c04b..1071fc354 100644 --- a/starlette/endpoints.py +++ b/starlette/endpoints.py @@ -43,7 +43,7 @@ async def method_not_allowed(self, request: Request) -> Response: class WebSocketEndpoint: - encoding = None # May be "text", "bytes", or "json". + encoding: typing.Optional[str] = None # May be "text", "bytes", or "json". def __init__(self, scope: Scope, receive: Receive, send: Send) -> None: assert scope["type"] == "websocket"