Skip to content

Commit

Permalink
Broaden type of extension parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Feb 15, 2025
1 parent 61a6a7a commit e934680
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/websockets/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ClientExtensionFactory:
name: ExtensionName
"""Extension identifier."""

def get_request_params(self) -> list[ExtensionParameter]:
def get_request_params(self) -> Sequence[ExtensionParameter]:
"""
Build parameters to send to the server for this extension.
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/extensions/permessage_deflate.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def __init__(
self.client_max_window_bits = client_max_window_bits
self.compress_settings = compress_settings

def get_request_params(self) -> list[ExtensionParameter]:
def get_request_params(self) -> Sequence[ExtensionParameter]:
"""
Build request parameters.
Expand Down
2 changes: 1 addition & 1 deletion src/websockets/headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def parse_extension(header: str) -> list[ExtensionHeader]:


def build_extension_item(
name: ExtensionName, parameters: list[ExtensionParameter]
name: ExtensionName, parameters: Sequence[ExtensionParameter]
) -> str:
"""
Build an extension definition.
Expand Down
4 changes: 2 additions & 2 deletions src/websockets/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import http
import logging
from typing import TYPE_CHECKING, Any, NewType, Optional, Union
from typing import TYPE_CHECKING, Any, NewType, Optional, Sequence, Union


__all__ = [
Expand Down Expand Up @@ -62,7 +62,7 @@

# Private types

ExtensionHeader = tuple[ExtensionName, list[ExtensionParameter]]
ExtensionHeader = tuple[ExtensionName, Sequence[ExtensionParameter]]
"""Extension in a ``Sec-WebSocket-Extensions`` header."""


Expand Down

0 comments on commit e934680

Please sign in to comment.