Skip to content

Commit c45284a

Browse files
author
Daniel Watkins
committed
Add comment explaining the status of RawConfigParser.items
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.
1 parent 711f33c commit c45284a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎stdlib/3/configparser.pyi‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ class RawConfigParser(_parser):
113113
...
114114

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

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

0 commit comments

Comments
 (0)