update SectionProxy.getint()/float/bool stubs to match those of ConfigParser (#3687)

This commit is contained in:
Brian Maissy
2020-01-30 10:37:29 +02:00
committed by GitHub
parent ad2ce11497
commit 48d77d5f06

View File

@@ -164,9 +164,18 @@ class SectionProxy(MutableMapping[str, str]):
# These are partially-applied version of the methods with the same names in
# RawConfigParser; the stubs should be kept updated together
def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ...
def getfloat(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ...
def getboolean(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ...
@overload
def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> int: ...
@overload
def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> Union[int, _T]: ...
@overload
def getfloat(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> float: ...
@overload
def getfloat(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> Union[float, _T]: ...
@overload
def getboolean(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> bool: ...
@overload
def getboolean(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> Union[bool, _T]: ...
# SectionProxy can have arbitrary attributes when custon converters are used
def __getattr__(self, key: str) -> Callable[..., Any]: ...