summary refs log tree commit diff
path: root/synapse/types.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-01-06 17:46:31 +0000
committerGitHub <noreply@github.com>2020-01-06 17:46:31 +0000
commit1807db5e73885933075b2d78022dd3547630265c (patch)
tree886766991b090d043456e376a6fb8b8cb5d50a50 /synapse/types.py
parentFix some test failures when frozen_dicts are enabled (#6642) (diff)
parentchangelog (diff)
downloadsynapse-1807db5e73885933075b2d78022dd3547630265c.tar.xz
Merge pull request #6629 from matrix-org/rav/kill_event_reference_hashes
Remove a bunch of unused code from event creation
Diffstat (limited to 'synapse/types.py')
-rw-r--r--synapse/types.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/types.py b/synapse/types.py

index aafc3ffe74..cd996c0b5a 100644 --- a/synapse/types.py +++ b/synapse/types.py
@@ -15,6 +15,7 @@ # limitations under the License. import re import string +import sys from collections import namedtuple import attr @@ -23,6 +24,17 @@ from unpaddedbase64 import decode_base64 from synapse.api.errors import SynapseError +# 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 Sized, Iterable, Container, TypeVar + + T_co = TypeVar("T_co", covariant=True) + + class Collection(Iterable[T_co], Container[T_co], Sized): + __slots__ = () + class Requester( namedtuple(