Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(typing): finalize annotations #2338

Merged
merged 10 commits into from
Sep 24, 2024
2 changes: 2 additions & 0 deletions falcon/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

"""Falcon App class."""

from __future__ import annotations

from functools import wraps
from inspect import iscoroutinefunction
import pathlib
Expand Down
2 changes: 2 additions & 0 deletions falcon/asgi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

"""ASGI application class."""

from __future__ import annotations

import asyncio
from inspect import isasyncgenfunction
from inspect import iscoroutinefunction
Expand Down
6 changes: 3 additions & 3 deletions falcon/asgi/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from falcon.constants import WebSocketPayloadType
from falcon.typing import AsgiReceive
from falcon.typing import AsgiSend
from falcon.typing import HeaderList
from falcon.typing import HeaderArg
from falcon.util import misc

__all__ = ('WebSocket',)
Expand Down Expand Up @@ -144,7 +144,7 @@ def supports_accept_headers(self) -> bool:
async def accept(
self,
subprotocol: Optional[str] = None,
headers: Optional[HeaderList] = None,
headers: Optional[HeaderArg] = None,
) -> None:
"""Accept the incoming WebSocket connection.

Expand All @@ -166,7 +166,7 @@ async def accept(
client may choose to abandon the connection in this case,
if it does not receive an explicit protocol selection.

headers (HeaderList): An iterable of ``(name: str, value: str)``
headers (HeaderArg): An iterable of ``(name: str, value: str)``
two-item iterables, representing a collection of HTTP headers to
include in the handshake response. Both *name* and *value* must
be of type ``str`` and contain only US-ASCII characters.
Expand Down
Loading