From e07553c3627b80f20cdc81a35030bf0540924db8 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 30 Oct 2018 14:58:48 +0000 Subject: Add type/return hints throughout src/ and, in doing so, fix some cyclical references. --- src/Config.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Config.py') diff --git a/src/Config.py b/src/Config.py index 611b5b7b..dacb14dd 100644 --- a/src/Config.py +++ b/src/Config.py @@ -1,7 +1,7 @@ -import configparser, os +import configparser, os, typing class Config(object): - def __init__(self, location): + def __init__(self, location: str): self.location = location self._config = {} self.load() @@ -13,10 +13,10 @@ class Config(object): parser.read_string(config_file.read()) self._config = dict(parser["bot"].items()) - def __getitem__(self, key): + def __getitem__(self, key: str) -> typing.Any: return self._config[key] - def get(self, key, default=None): + def get(self, key: str, default: typing.Any=None) -> typing.Any: return self._config.get(key, default) - def __contains__(self, key): + def __contains__(self, key: str) -> bool: return key in self._config -- cgit v1.3.1-10-gc9f91