summary refs log tree commit diff
path: root/synapse/types.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-10-20 17:42:11 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-10-20 17:42:11 +0100
commit41ac1232b5bd78f2dff5edd6c8b04c5ceb2aa87c (patch)
tree8c170802b61dcf7c200b8b4fd7b9e37a2ca51d0a /synapse/types.py
parentMerge commit 'e00816ad9' into anoa/dinsic_release_1_21_x (diff)
parentConvert additional database code to async/await. (#8195) (diff)
downloadsynapse-41ac1232b5bd78f2dff5edd6c8b04c5ceb2aa87c.tar.xz
Merge commit '5c03134d0' into anoa/dinsic_release_1_21_x
* commit '5c03134d0':
  Convert additional database code to async/await. (#8195)
  Define StateMap as immutable and add a MutableStateMap type. (#8183)
  Move and refactor LoginRestServlet helper methods (#8182)
Diffstat (limited to 'synapse/types.py')
-rw-r--r--synapse/types.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/types.py b/synapse/types.py

index e867cadbad..ee169a3be8 100644 --- a/synapse/types.py +++ b/synapse/types.py
@@ -18,7 +18,7 @@ import re import string import sys from collections import namedtuple -from typing import Any, Dict, Tuple, Type, TypeVar +from typing import Any, Dict, Mapping, MutableMapping, Tuple, Type, TypeVar import attr from signedjson.key import decode_verify_key_bytes @@ -42,8 +42,9 @@ else: # Define a state map type from type/state_key to T (usually an event ID or # event) T = TypeVar("T") -StateMap = Dict[Tuple[str, str], T] - +StateKey = Tuple[str, str] +StateMap = Mapping[StateKey, T] +MutableStateMap = MutableMapping[StateKey, T] # the type of a JSON-serialisable dict. This could be made stronger, but it will # do for now.