Fix some issues for dateutil and argparse (#357)

* Fix stubs for 2.7/dateutil. They were pretty broken.

(The 3/dateutil share some of the brokenness but that's still a TODO.)

* Fix argparse stubs.

- Container is not strong enough for choices.
- add_subparsers() returns something with an add_parser() method.
This commit is contained in:
Guido van Rossum
2016-07-12 16:24:33 -07:00
committed by David Fisher
parent 63cbe2dc3c
commit b63e09c239
2 changed files with 16 additions and 12 deletions

View File

@@ -27,13 +27,13 @@ class parserinfo(object):
def validate(self, res: datetime) -> bool: ...
class parser(object):
def __init__(self, info: Optional['parserinfo']) -> None: ...
def __init__(self, info: parserinfo = None) -> None: ...
def parse(self, timestr: Union[str, unicode, IO[unicode]],
default: Optional[datetime],
ignoretz: bool, tzinfos: Dict[Union[str, unicode], tzinfo],
**kwargs: Dict[str, Any]) -> datetime: ...
default: datetime = None,
ignoretz: bool = ..., tzinfos: Dict[Union[str, unicode], tzinfo] = None,
**kwargs: Any) -> datetime: ...
DEFAULTPARSER = ... # type: 'parser'
DEFAULTPARSER = ... # type: parser
def parse(timestr: Union[str, unicode, IO[unicode]],
parserinfo: Optional['parserinfo'],
**kwargs: Dict[str, Any]) -> datetime: ...
parserinfo: parserinfo = None,
**kwargs: Any) -> datetime: ...