From 9d911d1fa08d24b3fd97c595bb5bdc6470c1748a Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Fri, 3 Jan 2020 00:49:40 -0500 Subject: [PATCH] convince pylint about descriptor return type in lbry/conf.py --- lbry/conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lbry/conf.py b/lbry/conf.py index c351d2d3f..3fc7f2687 100644 --- a/lbry/conf.py +++ b/lbry/conf.py @@ -87,6 +87,10 @@ class String(Setting[str]): assert isinstance(value, str), \ f"Setting '{self.name}' must be a string." + # TODO: removes this after pylint starts to understand generics + def __get__(self, obj: typing.Optional['BaseConfig'], owner) -> str: # pylint: disable=useless-super-delegation + return super().__get__(obj, owner) + class Integer(Setting[int]): def validate(self, value): @@ -131,7 +135,7 @@ class Path(String): def __init__(self, doc: str, *args, default: str = '', **kwargs): super().__init__(doc, default, *args, **kwargs) - def __get__(self, obj, owner): + def __get__(self, obj, owner) -> str: value = super().__get__(obj, owner) if isinstance(value, str): return os.path.expanduser(os.path.expandvars(value))