Commit Graph

587 Commits

Author SHA1 Message Date
jdelic
05cd6ec5fa List should probably be Sequence (#387) 2016-07-22 13:19:49 -07:00
alvarocaceres
d7db6221da Change imports so pytype can parse them (#394)
* Change imports so pytype can parse them

relative imports -> absolute
import foo.bar as baz -> equivalent "from foo ..."

* fixup ...
2016-07-22 13:04:09 -07:00
alvarocaceres
b676e4af92 Remove non-stub code from pyis (#391)
* Remove non-stub code from pyis

Also removed @abstractmethod decorators from codecs stub

* add back @abstractmethod
2016-07-22 11:10:13 -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
Valérian Rousset
0863590721 add site (#389) 2016-07-22 07:38:17 -07:00
alvarocaceres
e02332a787 Misc. changes to help pytype parse typeshed (#382) 2016-07-21 13:08:12 -07:00
Michael Lee
368c703078 Add dict views to python 2 (#376) 2016-07-21 11:28:35 -07:00
Fabian Heredia Montiel
d787dbe984 Add conditional floor for Python 3.x (#380) 2016-07-21 11:08:21 -07:00
alvarocaceres
c1b12970f6 Change empty string literals to ellipsis (#377)
For pytype compatibility
2016-07-20 10:57:32 -07:00
Fabian Heredia Montiel
1d5df0bd7b Add enumera (#378) 2016-07-20 10:53:34 -07:00
Guido van Rossum
df5c64e247 Add StopAsyncIteration; also add StopIteration.value. 2016-07-19 19:45:36 -07:00
alvarocaceres
ac5916c170 Tweak version tests to help pytype parse them (#374) 2016-07-19 07:43:35 -07:00
Daniel F Moisset
ba349199d7 More general types for frozenset methods (#277)
Fixes #276.
2016-07-18 17:17:57 -07:00
Valérian Rousset
9b3fe3d0e0 add types to pathlib (#338) 2016-07-17 21:16:25 -07:00
Valérian Rousset
61f232c7d8 add py3 version to zipimport (#305) 2016-07-17 21:05:05 -07:00
Valérian Rousset
d5938ee76c Add cpython specific constants to ssl (#291)
* Revert "Revert "add types to ssl for py2 (#251)""

This reverts commit 0b19fb471c (thus re-adding types to ssl).

* add some undocumented ssl constants
2016-07-17 19:27:29 -07:00
Valérian Rousset
cf655f6f02 add some types to importlib (#340) 2016-07-15 15:46:28 -07:00
Guido van Rossum
6d8628c247 Misc asyncio changes (#373)
* Add stub for cgi.parse_header().

* Improve asyncio stubs (far from complete)

* More asyncio changes.

* Use @overload to solve strange test failures.

* Add some TODOs. Make ProactorEventLoop conditional.

* Future should not inherit from Awaitable or implement __await__.

At least not yet.

* Fix AbstractServer.wait_closed() return type.

It's a generator, not a future.
2016-07-15 15:44:29 -07:00
Guido van Rossum
6aeea2a872 Add stub for cgi.parse_header(). (#371) 2016-07-15 15:42:51 -07:00
Valérian Rousset
8ef221c162 add zipfile for py2 (#345) 2016-07-15 05:55:20 -07:00
Daniel
932737d322 Made the readfp method take in a BinaryIO type (#346)
* Made the readfp method take in a BinaryIO type

* moving from BinaryIO to IO[str]
2016-07-14 12:36:22 +01:00
speezepearson
534837e1ee add __{cause,context,traceback}__ to BaseException, per PEP 3134 (#369) 2016-07-13 15:26:55 -07:00
Jukka Lehtosalo
e05edb60f1 Mypy stub fixes for strict optional mode (#366) 2016-07-13 09:38:40 -07:00
Eklavya Sharma
bca4c81b70 builtins: Remove Exception.message. (#363)
It's not present in 3.4 either, so this looks good to me.
2016-07-13 16:11:51 +01:00
Guido van Rossum
53d126f4d4 More fixes for argparse. (#362) 2016-07-13 07:51:29 -07:00
speezepearson
e815c803a6 add ChainMap class to collections module (#361)
* add ChainMap class to collections module

* ...and add it for Python 2 as well.
2016-07-13 06:16:37 -07:00
speezepearson
e436795124 add default arguments to traceback.format_exception (#360) 2016-07-13 06:14:16 -07:00
Matthias Kramm
e19e10c891 Merge pull request #348 from sharmaeklavya2/fix-subprocess-check-output
subprocess: Fix return type of check_output.
2016-07-12 17:12:33 -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
Guido van Rossum
1c4662d2f3 Two small changes to help the mypy test suite pass (#355)
* Condition arg for skip{If,Unless} should be object, not bool.

* Env arg to os.get_exec_path() is a Mapping, not a Dict.
2016-07-12 14:10:36 -07:00
Matthias Kramm
b48ddf7532 Merge pull request #352 from tharvik/improve_argparse
merge py2 and py3 argparse
2016-07-11 06:36:25 -07:00
tharvik
87235ad72b merge py2 and py3 argparse 2016-07-11 15:23:51 +02:00
Matthias Kramm
90b9d4d77c Merge pull request #339 from tharvik/improve_os
add some types to os
2016-07-11 06:18:38 -07:00
tharvik
1833e8e4b6 add some types to os 2016-07-11 15:09:52 +02:00
tharvik
0e635efa6c add bytearray.insert 2016-07-11 14:04:18 +02:00
Eklavya Sharma
1cccc2d115 __builtin__: Fix bytearray on python 2
bytearray should inherit from MutableSequence[int] instead of
Sequence[int].
2016-07-09 02:34:20 +05:30
Eklavya Sharma
a62a7af1c5 __builtin__: Change signature of bytearray.__delitem__.
Signature of bytearray.__delitem__ is overloaded to support both
int and slice as parameters.  Use a union instead.
This is needed to change bytearray's superclass from Sequence[int]
to MutableSequence[int], because the current signature of
__delitem__ is incompatible with that of MutableSequence.
2016-07-09 02:31:13 +05:30
Matthias Kramm
0c75a22ffb Merge pull request #303 from sharmaeklavya2/sort-cmp
Add cmp to list.sort in python 2.7
2016-07-07 13:22:49 -07:00
Michael Lee
adc6bf5f94 Update set methods to take multiple iterables (#349)
As of Python 2.7, you can pass in multiple iterables into some set
methods like union, intersection, difference, and update. So, for
example, `new_set = a.union(b, c)`.
2016-07-07 11:52:22 -07:00
Eklavya Sharma
a7754c3eff subprocess: Fix return type of check_output.
check_output's return type can be str if universal_newlines=True.
2016-07-07 22:04:29 +05:30
Fu Yong Quah
8a23acc8ee Add stdlib/2.7/traceback._print 2016-07-07 08:41:16 -07:00
Matthias Kramm
f75bbae18d Merge pull request #344 from tharvik/improve_unittest
improve unittest
2016-07-07 06:36:06 -07:00
Eklavya Sharma
5962927d3d Add cmp to list.sort in python 2.7 2016-07-07 14:55:29 +05:30
Guido van Rossum
5088131e5a Correct type of formatter_class arg to ArgParse(). 2016-07-06 11:42:57 -07:00
Matthias Kramm
7bef3added Merge pull request #297 from alvarocaceres/subprocess
Fix signatures of call, check_call and check_output in subprocess
2016-07-06 10:54:01 -07:00
Valérian Rousset
3eedf73a3a Add types to stub for warnings module. (#342) 2016-07-06 09:58:49 -07:00
tharvik
e102c99f36 improve unittest 2016-07-06 11:33:48 +02:00
Guido van Rossum
8515cf5de8 Attempt to reduce cyclical dependencies between types and importlib. (#335)
- Move Loader and ModuleType into _importlib_modulespec.pyi.
- Add "import X as X" for these to types.pyi and importlib/abc.pyi.

The goal is to ensure mypy -i still works, to fix https://github.com/python/mypy/issues/1797.
2016-07-05 10:23:24 -07:00
Elazar
8fb9f4a8f1 Add stubs for dis and opcode (#331) 2016-07-05 10:18:58 -07:00