Commit Graph

247 Commits

Author SHA1 Message Date
Michael R. Crusoe
cc735b1176 expose xml.sax Exceptions (#280) 2016-07-26 07:45:27 -07:00
Michael Lee
9ecc1f2147 Add stubs for NewType helper function (#398)
(Note that this is not enough to support NewType(). However it's a prerequisite for the mypy implementation.)
2016-07-26 07:35:28 -07:00
Wojciech Kaczmarek
a93b491fed Add Py2 BaseHTTPServer (#397)
Fixes #395
2016-07-25 16:14:02 -07:00
Alvaro Caceres
746f4db989 Change constants to type-equivalent versions (#392)
* Change constants to type-equivalent versions

For pytype support.

" = object()" -> " = ..."
Non-zero ints -> 0

* Drop changes to typing and __builtin__
2016-07-25 13:03:42 -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
alvarocaceres
f7b35bc8be Remove line continuations to help pytype parse (#390) 2016-07-22 10:55:42 -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
alvarocaceres
c1b12970f6 Change empty string literals to ellipsis (#377)
For pytype compatibility
2016-07-20 10:57:32 -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
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
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
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
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
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
Fu Yong Quah
8a23acc8ee Add stdlib/2.7/traceback._print 2016-07-07 08:41:16 -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
Dakkaron
a393897c9a Added JSONEncoder and JSONDecoder to stdlib/2.7/json.pyi (#332) 2016-07-04 18:24:23 -07:00
David Fisher
c5dcfe96d2 Add exec to Python 2 builtins (#328) 2016-07-01 19:04:12 -07:00
OrenLeaffer
998d787302 fix return type for traceback.format_exception (#326)
format_exception and format_exception_only both return lists of
strings, not strings.
2016-07-01 16:03:25 -07:00
Drew Haven
b5978b18b6 Add tarfile.open (#324) 2016-06-30 17:36:58 -07:00
Amit Saha
2e555c81b8 stdlib: StringIO - Add len attribute issue #316 2016-06-30 18:52:32 +10:00
tewe
c84c138194 Annotate **kwargs with dictionary value type only (#320) 2016-06-29 08:43:13 -07:00
tewe
ab4734ff7f Use actual base type (#313)
Avoids "Exception type must be derived from BaseException"
2016-06-28 18:26:54 +01:00
Philip House
4a79dec6ba adding type-specific assertEqual cases (#315)
Adding support for type-specific equality methods (see https://docs.python.org/2.7/library/unittest.html?highlight=assertlistequals#unittest.TestCase.addTypeEqualityFunc) in the unittest stub for both 2.7/3. As requested by @gvanrossum in #308
2016-06-28 08:12:27 -07:00
Amandine Lee
03326014a5 Use unicode rather than str for os env functions (#312) 2016-06-24 11:18:24 -07:00
Russ Allbery
9f3d84551d Add stub for statvfs and type for fstatvfs (2.7) (#311)
Use the same approach as for resource: define a private NamedTuple
to represent the return value that can be addressed by name or by
sequence.
2016-06-23 17:39:06 -07:00
Russ Allbery
0c26482488 difflib functions return Iterators, not Iterables (#310)
These functions all use yield.  It's valid to call the next method
on the return value, which is not true of Iterables.
2016-06-23 17:35:25 -07:00
Russ Allbery
6e3514ccd0 Fix names of several stat constants (2.7) (#309)
Several of the constants were mistakenly stubbed with names
starting with ST_ instead of S_.  Fix them to match the module
documentation.
2016-06-23 14:42:05 -07:00
Philip House
d2db605008 fixes #131 (#308) 2016-06-21 08:16:24 -07:00
Matthias Kramm
37bc4987be Merge pull request #299 from alvarocaceres/csv
csv module: make reader() and writer() return types private and non-abstract
2016-06-15 15:01:28 -07:00
Alvaro Caceres
122da1ca3f Add Any for collections.pyi 2016-06-15 15:57:55 -05:00
Alvaro Caceres
84c76f8188 csv module: make reader() and writer() return types private and non-abstract 2016-06-15 14:12:06 -05:00
Alvaro Caceres
d0ac66f5f8 Use "..." for attribute values, instead of None, [], {} 2016-06-15 14:10:04 -05:00
Alvaro Caceres
5886a5dfcd Fix signatures of call, check_call and check_output in subprocess 2016-06-15 13:34:02 -05:00
Philip House
dee5e7a1df changed format_exception to use BaseException as value (#292) 2016-06-15 09:52:04 -07:00
Guido van Rossum
89dfe15008 Add TYPE_CHECKING = True 2016-06-10 17:27:12 -07:00
Guido van Rossum
0b19fb471c Revert "add types to ssl for py2 (#251)"
This reverts commit 4039a1a686.

Reason: several constants (e.g. SSL_ERROR_EOF, SSL_ERROR_SSL, SSL_ERROR_WANT_READ and a few others) are missing.
2016-06-10 17:26:36 -07:00
Dakkaron
59d64f4e2b re methods' pattern-parameters don't affect the return value anymore (#281)
Note that this is a 2.7-only change (in Python 3, the pattern type must match the other parameter and the result).
2016-06-09 09:54:59 -07:00
Tim Abbott
6da0bcec4c Fix argument type for datetime.now. (#268)
It seems to actually take a tzinfo argument, not its subclass
timezone.
2016-06-06 15:21:11 -07:00
Valérian Rousset
c40a260b47 fix sys.exc_info return type (#246) 2016-06-06 08:52:40 -07:00