I have some Python code (running for Python 3.5, 3.6 and 3.7) and added some type hints for static type checks using mypy.
Please take a look at the following snippe
You can use typing
module
import typing
class MyParams(Singleton, metaclass=MyParamsMeta):
@classmethod
def keys(cls) -> typing.collections.KeysView:
return cls._params.keys()
@classmethod
def items(cls) -> typing.collections.ItemsView:
return cls._params.items()
_params = _load_from_csv() # returns Dict[str, MyParam]