mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:46:02 -04:00
Remove synapse.types.Collection
(#9856)
This is no longer required, since we have dropped support for Python 3.5.
This commit is contained in:
parent
3186324260
commit
294c675033
26 changed files with 77 additions and 62 deletions
|
@ -15,13 +15,11 @@
|
|||
import abc
|
||||
import re
|
||||
import string
|
||||
import sys
|
||||
from collections import namedtuple
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
Dict,
|
||||
Iterable,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
Optional,
|
||||
|
@ -50,18 +48,6 @@ if TYPE_CHECKING:
|
|||
from synapse.appservice.api import ApplicationService
|
||||
from synapse.storage.databases.main import DataStore
|
||||
|
||||
# define a version of typing.Collection that works on python 3.5
|
||||
if sys.version_info[:3] >= (3, 6, 0):
|
||||
from typing import Collection
|
||||
else:
|
||||
from typing import Container, Sized
|
||||
|
||||
T_co = TypeVar("T_co", covariant=True)
|
||||
|
||||
class Collection(Iterable[T_co], Container[T_co], Sized): # type: ignore
|
||||
__slots__ = ()
|
||||
|
||||
|
||||
# Define a state map type from type/state_key to T (usually an event ID or
|
||||
# event)
|
||||
T = TypeVar("T")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue