diff options
| author | 2018-10-30 14:58:48 +0000 | |
|---|---|---|
| committer | 2018-10-30 14:58:48 +0000 | |
| commit | e07553c3627b80f20cdc81a35030bf0540924db8 (patch) | |
| tree | 0a81640b280e007cbe5d2cb956681068ab80c58e /src/Config.py | |
| parent | Don't needlessly search a youtube URL before getting the information for it's (diff) | |
| signature | ||
Add type/return hints throughout src/ and, in doing so, fix some cyclical
references.
Diffstat (limited to 'src/Config.py')
| -rw-r--r-- | src/Config.py | 10 |
1 files changed, 5 insertions, 5 deletions
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 |
