Skip to content

Commit

Permalink
Add type annotation to WebSocketEndpoint.encoding (#1003)
Browse files Browse the repository at this point in the history
* Add type annotation to WebSocketEndpoint.encoding

* Update endpoints.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
  • Loading branch information
trickeydan and florimondmanca committed Jul 24, 2020
1 parent 4935397 commit aee9106
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starlette/endpoints.py
Expand Up @@ -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"
Expand Down

0 comments on commit aee9106

Please sign in to comment.