Commit Graph

12 Commits

Author SHA1 Message Date
Jukka Lehtosalo
97bd6e37b9 Update argparse to accept unicode in many contexts
Change `str` to `Union[str, unicode]` where it seems safe.
I didn't change it in non-covariant contexts since that can
break user code.

I manually verified a subset of the changes by calling the
relevant function with unicode literals (ascii-only).

I'm using `Union[str, unicode]` instead of just `unicode`
so that the stub still works with tools that don't promote
`str` objects to `unicode`.
2017-01-18 08:43:49 -08:00
Robin Alazard
1002950322 Add missing method add_mutually_exclusive_group(...) to argparse group (#573) 2016-09-26 12:07:47 -07:00
Tom Manderson
9fd0fd97c6 Make FileType valid for ArgumentParser 'type' arg (#473) 2016-08-15 11:42:48 -07:00
Guido van Rossum
39325bf159 Mypy now supports sys.platform and sys.version_info checks (#410) 2016-07-27 13:25:29 -07:00
jdelic
ba69b32d06 argparse stub fix: parse_known_args takes an optional sequence of strings like parse_args(), not an optional string (#386)
* parse_known_args takes an optional sequence of strings like parse_args, not an optional string
2016-07-22 14:39:56 -07:00
jdelic
791966a65a argparse stub fix: allow subclasses of Action in add_argument(action=...) (#385)
The action was incorrectly typed as allowing instances of Action -- the correct type is subclasses of Action. (And str.)
2016-07-22 14:38:24 -07:00
jdelic
05cd6ec5fa List should probably be Sequence (#387) 2016-07-22 13:19:49 -07:00
jdelic
4f7c9ce432 argparse stub fix: values parameter of Action can also be str and None (#388)
* values can be a str, too

* values should probably use Sequence
2016-07-22 10:58:59 -07:00
alvarocaceres
f7b35bc8be Remove line continuations to help pytype parse (#390) 2016-07-22 10:55:42 -07:00
Guido van Rossum
53d126f4d4 More fixes for argparse. (#362) 2016-07-13 07:51:29 -07:00
Guido van Rossum
b63e09c239 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.
2016-07-12 16:24:33 -07:00
tharvik
87235ad72b merge py2 and py3 argparse 2016-07-11 15:23:51 +02:00