Remove synapse.types.Collection (#9856)

This is no longer required, since we have dropped support for Python 3.5.
This commit is contained in:
Richard van der Hoff 2021-04-22 16:43:50 +01:00 committed by GitHub
parent 3186324260
commit 294c675033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 77 additions and 62 deletions

View file

@ -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")