mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
make stubs for configparser.getint()/float/bool accept a generically-typed fallback (#3684)
Closes #3681
This commit is contained in:
@@ -104,11 +104,19 @@ class RawConfigParser(_parser):
|
||||
|
||||
# These get* methods are partially applied (with the same names) in
|
||||
# SectionProxy; the stubs should be kept updated together
|
||||
def getint(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ...
|
||||
|
||||
def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ...
|
||||
|
||||
def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ...
|
||||
@overload
|
||||
def getint(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> int: ...
|
||||
@overload
|
||||
def getint(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> Union[int, _T]: ...
|
||||
@overload
|
||||
def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> float: ...
|
||||
@overload
|
||||
def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> Union[float, _T]: ...
|
||||
@overload
|
||||
def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> bool: ...
|
||||
@overload
|
||||
def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> Union[bool, _T]: ...
|
||||
|
||||
def _get_conv(self, section: str, option: str, conv: Callable[[str], _T], *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> _T: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user