Commit Graph

3 Commits

Author SHA1 Message Date
Joe Bateson
385b9c8b66 Fix optparse OptionGroup __init__ to allow missing description (#1248) 2017-05-06 12:39:55 -07:00
Guido van Rossum
a934d57f3b [optparse] Change Uses of List[] to Sequence[] in argument positions. (#1179)
* Change Uses of List[] to Sequence[] in argument positions.

One of these (parse_args()) broke in real-world code, because the
expected type was List[Union[str, bytes]] but the actual type was
List[str] (because List is invariant).  That is ridiculous, so I
changed the accepted type to Sequence[_Text] which is covariant.  Then
I found a few other methods/functions that probably should also be
changed to Sequence, but I'm less certain of those.  I'm not at all
sure about the instance/class attributes, so I left those alone
(though I suspect those might also have to switch).

* Fixes suggested by code review

- Changed Sequence[Option] to Iterable[Option] everywhere
- Changed _process_args to plain List
2017-04-21 12:22:24 -07:00
Ethan
625ea80a99 update OptParse to work on 2and3 (#1164)
* update OptParse to work on 2and3

* remove duplicative dunder methods in Option

* Union Nones to Optional and Text->_Text
2017-04-19 06:10:07 -07:00