Use less restrictive Sequence

This commit is contained in:
Eric Eastwood
2026-03-25 18:09:57 -05:00
parent 45b1086d33
commit 54dc2bed3d
2 changed files with 7 additions and 6 deletions

View File

@@ -19,7 +19,7 @@
#
#
import logging
from typing import TYPE_CHECKING, cast
from typing import TYPE_CHECKING, Sequence, cast
import attr
@@ -80,7 +80,7 @@ class GetMessagesResult:
Everything needed to serialize a `/messages` response.
"""
messages_chunk: list[EventBase]
messages_chunk: Sequence[EventBase]
"""
A list of room events.
@@ -93,7 +93,7 @@ class GetMessagesResult:
available. Clients should continue to paginate until no `end_token` property is returned.
"""
gaps: list[EventGapEntry]
gaps: Sequence[EventGapEntry]
"""
A list of gaps in the `messages_chunk`
"""
@@ -105,7 +105,7 @@ class GetMessagesResult:
If an event doesn't have any bundled aggregations, it may not appear in the map.
"""
state: list[EventBase] | None
state: Sequence[EventBase] | None
"""
A list of state events relevant to showing the chunk. For example, if
lazy_load_members is enabled in the filter then this may contain the membership

View File

@@ -31,6 +31,7 @@ from typing import (
Literal,
Mapping,
MutableMapping,
Sequence,
cast,
overload,
)
@@ -2494,8 +2495,8 @@ class EventsWorkerStore(SQLBaseStore):
)
async def get_events_next_to_gaps(
self, events: list[EventBase], direction: Direction
) -> list[EventGapEntry]:
self, events: Sequence[EventBase], direction: Direction
) -> Sequence[EventGapEntry]:
"""
Find all of the events that have gaps next to them.