typing is .. good?

This commit is contained in:
meejah 2023-08-11 23:47:24 -06:00
parent 356a1d0f79
commit a5b95273d7

View File

@ -33,7 +33,7 @@ Ported to Python 3.
from __future__ import annotations from __future__ import annotations
from six import ensure_text from six import ensure_text
from typing import Union, Callable, Any, Optional, cast from typing import Union, Callable, Any, Optional, cast, Dict
from os import urandom from os import urandom
import re import re
import time import time
@ -202,14 +202,15 @@ class StorageClientConfig(object):
in getPlugins(IFoolscapStoragePlugin) in getPlugins(IFoolscapStoragePlugin)
} }
configured = dict() # mypy doesn't like "str" in place of Any ...
configured: Dict[Any, IFoolscapStoragePlugin] = dict()
for plugin_name in self.storage_plugins: for plugin_name in self.storage_plugins:
try: try:
plugin = plugins[plugin_name] plugin = plugins[plugin_name]
except KeyError: except KeyError:
raise MissingPlugin(plugin_name) raise MissingPlugin(plugin_name)
configured[plugin_name] = plugin configured[plugin_name] = plugin
return configured # type: ignore return configured
@implementer(IStorageBroker) @implementer(IStorageBroker)