Skip to content

Commit

Permalink
Add comment explaining the status of RawConfigParser.items
Browse files Browse the repository at this point in the history
TL;DR, we're hitting python/mypy#3805 when
implemented correctly as an override, and
python/mypy#1855 when we try to work around
that with a union.
  • Loading branch information
Daniel Watkins committed Aug 21, 2017
1 parent 711f33c commit c45284a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stdlib/3/configparser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ class RawConfigParser(_parser):
...

# This is incompatible with Mapping so we ignore the type.
# This should really be an override with the following line added. See
# https://github.com/python/mypy/issues/3805 for why it isn't.
# def items(self, section: str = ..., raw: bool = ..., vars: _section = ...) -> Iterable[Tuple[str, str]]: ...
# (It could be a union of the two in the meantime, to improve matters
# slightly, but then we hit https://github.com/python/mypy/issues/1855.)
def items(self, section: Optional[str] = ..., raw: bool = ..., vars: _section = ...) -> Iterable[Tuple[str, SectionProxy]]: ... # type: ignore

def set(self, section: str, option: str, value: str) -> None: ...
Expand Down

0 comments on commit c45284a

Please sign in to comment.