Skip to content

Commit 89dcb62

Browse files
committed
[channels] Weaken a couple of other list parameter types
1 parent 0d165cf commit 89dcb62

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

stubs/channels/channels/utils.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from collections.abc import Awaitable, Callable
1+
from collections.abc import Awaitable, Callable, Sequence
22
from typing import Any, Protocol, type_check_only
33
from typing_extensions import TypeAlias
44

55
from asgiref.typing import ASGIApplication, ASGIReceiveCallable
66

77
def name_that_thing(thing: object) -> str: ...
88
async def await_many_dispatch(
9-
consumer_callables: list[Callable[[], Awaitable[ASGIReceiveCallable]]], dispatch: Callable[[dict[str, Any]], Awaitable[None]]
9+
consumer_callables: Sequence[Callable[[], Awaitable[ASGIReceiveCallable]]], dispatch: Callable[[dict[str, Any]], Awaitable[None]]
1010
) -> None: ...
1111

1212
# Defines a generic ASGI middleware protocol.

stubs/channels/channels/worker.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
from collections.abc import Collection
2+
13
from asgiref.server import StatelessServer
24
from channels.layers import BaseChannelLayer
35
from channels.utils import _ChannelApplication
46

57
class Worker(StatelessServer):
6-
channels: list[str]
8+
channels: Collection[str]
79
channel_layer: BaseChannelLayer
810

911
def __init__(
10-
self, application: _ChannelApplication, channels: list[str], channel_layer: BaseChannelLayer, max_applications: int = 1000
12+
self, application: _ChannelApplication, channels: Collection[str], channel_layer: BaseChannelLayer, max_applications: int = 1000
1113
) -> None: ...
1214
async def handle(self) -> None: ...
1315
async def listener(self, channel: str) -> None: ...

0 commit comments

Comments
 (0)