Commit Graph

275 Commits

Author SHA1 Message Date
Valérian Rousset
9f1e90b33f Merge bisect (#468)
* merge bisect

* comment while mypy#2035
2016-08-24 06:07:40 -07:00
Tomasz Elendt
34175b888d Fix __setitem__(slice, ...) of various mutable sequences (#496)
Adds support of assigning iterables to slice of mutable sequences and
bytes to bytearray's slice.
2016-08-23 19:02:50 -07:00
David Euresti
ed7c0779f7 Add memoryview class for python 2.7 (#493) 2016-08-23 18:48:10 -07:00
peterdotran
aef68f323f Added attributes for URLError and HTTPError (#494) 2016-08-23 17:55:51 -07:00
Nicholas Bishop
a20d5c481a Add type stub for typing.get_type_hints (#480)
Fixes issue #477
2016-08-16 20:41:01 -07:00
kosaka
5a79ba1abb Fixes tzinfo return types (#476) 2016-08-16 08:07:00 -07:00
tonygrue-dbx
219c57a28c Add winerror to WindowsError in builtins.pyi for Python 2.7 and 3 (#470)
Adds the int type member to WindowsError stub
2016-08-15 11:41:05 -07:00
David Euresti
69fdea09c9 Fix some type errors in gettext in python2. (#469)
Also makes it look more like the python3 version
2016-08-15 11:40:16 -07:00
Emanuel Barry
0989cb1cb3 Add FrozenSet to the typing stub files (#474) 2016-08-13 19:34:38 -07:00
Valérian Rousset
2824cd1197 Improve locale (#462) 2016-08-10 13:52:29 -07:00
Valérian Rousset
04d799f656 fix unprecise type in sys.exc_info in py2 (#466) 2016-08-10 13:37:01 -07:00
Jakub Stasiak
0edb87fc6b Make functools.cmp_to_key more realistic (#458)
The documentation[1] says:

    A comparison function is any callable that accept two arguments,
    compares them, and returns a negative number for less-than, zero for
    equality, or a positive number for greater-than.

This doesn't seem possible with the comparison function defined as
returning bool.

[1] https://docs.python.org/3.6/library/functools.html#functools.cmp_to_key
2016-08-10 12:12:52 -07:00
Jakub Stasiak
f3818cabbc Handle passing a tuple of types to issubclass() (#459)
It can't be just any sequence hence Tuple is used instead of previously
mentioned Sequence.
2016-08-10 12:09:16 -07:00
Valérian Rousset
4e55f0561f Improve traceback (#465) 2016-08-10 11:18:35 -07:00
David Fisher
f209136b3c Make appropriate Popen constructor args Optional (#457) 2016-08-08 20:14:13 -07:00
Fu Yong Quah
6c1a185e49 Add exception globals in 2.7/sys.pyi. (#440) 2016-08-05 12:04:57 -07:00
David Euresti
89091458ed Fix Tuple being imported twice in ast.pyi (#442) 2016-08-05 06:54:01 -07:00
Matthias Kramm
b46658c104 remove stray ',' 2016-08-04 15:40:12 -07:00
Valérian Rousset
2e560d38dc Improve distutils (#418)
* remove old distutils

* core done

* ccompiler done

* compilers done

* archive_util done

* dep_util done

* dir_util done

* file_util done

* util done

* dist done

* debug, error, extension done

* fancy_getopt done

* filelist, log, spawn done

* sysconfig done

* text_file done

* version done

* cmd done

* add command

* add emxccompiler which is py2 only

* command.build_py have spec only in py3

* make pytype happy by resolving relative import
2016-08-03 15:38:15 -07:00
Guido van Rossum
6e596e9609 Fix decimal and contextlib (#428)
* Decimal does not support __round__, and its __abs__ returns Decimal.

* Fix contextmanager signature too.
2016-08-02 07:39:13 -07:00
Valérian Rousset
ee02a8a968 Improve threading (#403)
* initial stubgen

* comment everything

* 17.1.0 done

* 17.1.1 done

* 17.1.2 done

* 17.1.3 done

* 17.1.4 done

* 17.1.5 done

* reorder __enter__, __exit__

* 17.1.6 done

* 17.1.7 done

* 17.1.8 done

* 17.1.9 done

* cleanup, py3 done

* py2 begin, comment everything

* 16.2.0 done

* 16.2.1 done

* 16.2.2 done

* 16.2.3 done

* 16.2.4 done

* 16.2.5 done

* 16.2.6 done

* 16.2.7 done

* cleanup, py2 done

* remove old threading stubs

* use --strict-optional

* improve Condition.wait_for

* remove type ignore
2016-08-01 14:31:57 -07:00
Valérian Rousset
1bd78d4aab Improve contextlib (#406)
* remove old, new stubgen

* comment everything

* contextlib done

* use TypeVar instead of overload

* py2 done
2016-07-29 15:26:14 -07:00
Valérian Rousset
cfde32b93f Add mimetypes (#404)
* remove old mimetypes, new stubgen

* reorder, cleanup

* py3 pass (py2 pass empty)
2016-07-29 05:50:46 -07:00
Guido van Rossum
781b079f91 Add Supports{Abs,Float,Int,Round} as base classes for Decimal. (#415) 2016-07-28 15:13:27 -07:00
Alvaro Caceres
6701a10e93 Add 2.7/decimal.pyi generated by stubgen (#414)
* add decimaly.pyi

generated with
 stubgen --py2 decimal

* Strip out private stuff

* pytype compatibility

* fixes
2016-07-28 11:09:48 -07:00
Valérian Rousset
557579da36 merge py2 and py3 errno (#413) 2016-07-28 06:15:22 -07:00
johnklai1
112a1a17dd Add S_IRWXG to Python 2.7's stat.pyi file. (#409)
Fixes #408.
2016-07-27 11:29:12 -07:00
Valérian Rousset
cd413c502c Add hmac (#402) 2016-07-26 08:40:04 -07:00
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