mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 22:34:56 -04:00
Add type hints to some storage classes (#11307)
This commit is contained in:
parent
6ce19b94e8
commit
64ef25391d
9 changed files with 116 additions and 54 deletions
|
@ -13,7 +13,7 @@
|
|||
# limitations under the License.
|
||||
import logging
|
||||
from types import TracebackType
|
||||
from typing import TYPE_CHECKING, Dict, Optional, Tuple, Type
|
||||
from typing import TYPE_CHECKING, Optional, Tuple, Type
|
||||
from weakref import WeakValueDictionary
|
||||
|
||||
from twisted.internet.interfaces import IReactorCore
|
||||
|
@ -62,7 +62,9 @@ class LockStore(SQLBaseStore):
|
|||
|
||||
# A map from `(lock_name, lock_key)` to the token of any locks that we
|
||||
# think we currently hold.
|
||||
self._live_tokens: Dict[Tuple[str, str], Lock] = WeakValueDictionary()
|
||||
self._live_tokens: WeakValueDictionary[
|
||||
Tuple[str, str], Lock
|
||||
] = WeakValueDictionary()
|
||||
|
||||
# When we shut down we want to remove the locks. Technically this can
|
||||
# lead to a race, as we may drop the lock while we are still processing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue