Skip to content

Replicate RawConfigParser.get* methods in SectionProxy #1568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions stdlib/3/configparser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class RawConfigParser(_parser):
def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]],
source: str = ...) -> None: ...

# 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: _section = ..., fallback: int = ...) -> int: ...

def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: _section = ..., fallback: float = ...) -> float: ...
Expand Down Expand Up @@ -160,6 +162,13 @@ class SectionProxy(MutableMapping[str, str]):
@property
def name(self) -> str: ...
def get(self, option: str, fallback: Optional[str] = ..., *, raw: bool = ..., vars: Optional[_section] = ..., **kwargs: Any) -> str: ... # type: ignore

# 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: _section = ..., fallback: int = ...) -> int: ...
def getfloat(self, option: str, *, raw: bool = ..., vars: _section = ..., fallback: float = ...) -> float: ...
def getboolean(self, option: str, *, raw: bool = ..., vars: _section = ..., fallback: bool = ...) -> bool: ...

# SectionProxy can have arbitrary attributes when custon converters are used
def __getattr__(self, key: str) -> Callable[..., Any]: ...

Expand Down