mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
* Make configparser.RawConfigParser.__getitem__ return a SectionProxy
This reflects the code in the cpython tree and makes the following
(valid) code type-check correctly:
```
from configparser import ConfigParser
config = ConfigParser()
config.read_dict({'section': {'key': 'false'}})
assert config['section'].getboolean('key') is False
```
* RawConfigParser.items() returns SectionProxys not mappings
Because .items() uses __getitem__ to produce second item in each tuple.
* section argument to RawConfigParser.items is Optional
* Add comment explaining the status of RawConfigParser.items
TL;DR, we're hitting https://github.com/python/mypy/issues/3805 when
implemented correctly as an override, and
https://github.com/python/mypy/issues/1855 when we try to work around
that with a union.
* Correctly implement RawConfigParser.items overloading
* RawConfigParser.items(str) returns a List not an Iterable